Adjust remaining type hints in alarm properties (#74126)

This commit is contained in:
epenet 2022-06-28 15:22:46 +02:00 committed by GitHub
parent 3836da48b3
commit 29c389b342
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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