mirror of
https://github.com/home-assistant/core.git
synced 2025-11-14 21:40:16 +00:00
Use assignment expressions 20 (#57969)
This commit is contained in:
@@ -205,8 +205,7 @@ class MqttAlarm(MqttEntity, alarm.AlarmControlPanelEntity):
|
||||
@property
|
||||
def code_format(self):
|
||||
"""Return one or more digits/characters."""
|
||||
code = self._config.get(CONF_CODE)
|
||||
if code is None:
|
||||
if (code := self._config.get(CONF_CODE)) is None:
|
||||
return None
|
||||
if code == REMOTE_CODE or (isinstance(code, str) and re.search("^\\d+$", code)):
|
||||
return alarm.FORMAT_NUMBER
|
||||
|
||||
Reference in New Issue
Block a user