Replace Alarm Control Panel FORMAT_ constants with CodeFormat enum (#69861)

This commit is contained in:
Franck Nijhof 2022-04-18 19:37:32 +02:00 committed by GitHub
parent 81f3c82aef
commit 1e4aacaeb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 65 additions and 47 deletions

View file

@ -235,8 +235,8 @@ class MqttAlarm(MqttEntity, alarm.AlarmControlPanelEntity):
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
return alarm.FORMAT_TEXT
return alarm.CodeFormat.NUMBER
return alarm.CodeFormat.TEXT
@property
def code_arm_required(self):