Adjust type hints for AlarmControlPanelEntityFeature (#82186)
This commit is contained in:
parent
1f0691bf18
commit
f952b74b74
4 changed files with 5 additions and 5 deletions
|
@ -133,7 +133,7 @@ class AlarmControlPanelEntity(Entity):
|
||||||
_attr_changed_by: str | None = None
|
_attr_changed_by: str | None = None
|
||||||
_attr_code_arm_required: bool = True
|
_attr_code_arm_required: bool = True
|
||||||
_attr_code_format: CodeFormat | None = None
|
_attr_code_format: CodeFormat | None = None
|
||||||
_attr_supported_features: int
|
_attr_supported_features: AlarmControlPanelEntityFeature | int
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def code_format(self) -> CodeFormat | None:
|
def code_format(self) -> CodeFormat | None:
|
||||||
|
@ -207,7 +207,7 @@ class AlarmControlPanelEntity(Entity):
|
||||||
await self.hass.async_add_executor_job(self.alarm_arm_custom_bypass, code)
|
await self.hass.async_add_executor_job(self.alarm_arm_custom_bypass, code)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self) -> int:
|
def supported_features(self) -> AlarmControlPanelEntityFeature | int:
|
||||||
"""Return the list of supported features."""
|
"""Return the list of supported features."""
|
||||||
return self._attr_supported_features
|
return self._attr_supported_features
|
||||||
|
|
||||||
|
|
|
@ -243,7 +243,7 @@ class MqttAlarm(MqttEntity, alarm.AlarmControlPanelEntity):
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self) -> int:
|
def supported_features(self) -> AlarmControlPanelEntityFeature:
|
||||||
"""Return the list of supported features."""
|
"""Return the list of supported features."""
|
||||||
return (
|
return (
|
||||||
AlarmControlPanelEntityFeature.ARM_HOME
|
AlarmControlPanelEntityFeature.ARM_HOME
|
||||||
|
|
|
@ -39,7 +39,7 @@ from .entity import OverkizDescriptiveEntity
|
||||||
class OverkizAlarmDescriptionMixin:
|
class OverkizAlarmDescriptionMixin:
|
||||||
"""Define an entity description mixin for switch entities."""
|
"""Define an entity description mixin for switch entities."""
|
||||||
|
|
||||||
supported_features: int
|
supported_features: AlarmControlPanelEntityFeature
|
||||||
fn_state: Callable[[Callable[[str], OverkizStateType]], str]
|
fn_state: Callable[[Callable[[str], OverkizStateType]], str]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -661,7 +661,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="supported_features",
|
function_name="supported_features",
|
||||||
return_type="int",
|
return_type=["AlarmControlPanelEntityFeature", "int"],
|
||||||
),
|
),
|
||||||
TypeHintMatch(
|
TypeHintMatch(
|
||||||
function_name="alarm_disarm",
|
function_name="alarm_disarm",
|
||||||
|
|
Loading…
Add table
Reference in a new issue