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_code_arm_required: bool = True
|
||||
_attr_code_format: CodeFormat | None = None
|
||||
_attr_supported_features: int
|
||||
_attr_supported_features: AlarmControlPanelEntityFeature | int
|
||||
|
||||
@property
|
||||
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)
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> AlarmControlPanelEntityFeature | int:
|
||||
"""Return the list of supported features."""
|
||||
return self._attr_supported_features
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ class MqttAlarm(MqttEntity, alarm.AlarmControlPanelEntity):
|
|||
return self._state
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
def supported_features(self) -> AlarmControlPanelEntityFeature:
|
||||
"""Return the list of supported features."""
|
||||
return (
|
||||
AlarmControlPanelEntityFeature.ARM_HOME
|
||||
|
|
|
@ -39,7 +39,7 @@ from .entity import OverkizDescriptiveEntity
|
|||
class OverkizAlarmDescriptionMixin:
|
||||
"""Define an entity description mixin for switch entities."""
|
||||
|
||||
supported_features: int
|
||||
supported_features: AlarmControlPanelEntityFeature
|
||||
fn_state: Callable[[Callable[[str], OverkizStateType]], str]
|
||||
|
||||
|
||||
|
|
|
@ -661,7 +661,7 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||
),
|
||||
TypeHintMatch(
|
||||
function_name="supported_features",
|
||||
return_type="int",
|
||||
return_type=["AlarmControlPanelEntityFeature", "int"],
|
||||
),
|
||||
TypeHintMatch(
|
||||
function_name="alarm_disarm",
|
||||
|
|
Loading…
Add table
Reference in a new issue