mirror of https://github.com/home-assistant/core
Adjust remaining type hints in alarm properties (#74126)
This commit is contained in:
parent
3836da48b3
commit
29c389b342
|
@ -141,14 +141,14 @@ class EnvisalinkAlarm(EnvisalinkDevice, AlarmControlPanelEntity):
|
|||
self.async_write_ha_state()
|
||||
|
||||
@property
|
||||
def code_format(self):
|
||||
def code_format(self) -> CodeFormat | None:
|
||||
"""Regex for code format or None if no code is required."""
|
||||
if self._code:
|
||||
return None
|
||||
return CodeFormat.NUMBER
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
def state(self) -> str:
|
||||
"""Return the state of the device."""
|
||||
state = STATE_UNKNOWN
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ class TuyaAlarmEntity(TuyaEntity, AlarmControlPanelEntity):
|
|||
self._attr_supported_features |= AlarmControlPanelEntityFeature.TRIGGER
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
def state(self) -> str | None:
|
||||
"""Return the state of the device."""
|
||||
if not (status := self.device.status.get(self.entity_description.key)):
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue