Replace Alarm Control Panel FORMAT_ constants with CodeFormat enum (#69861)
This commit is contained in:
parent
81f3c82aef
commit
1e4aacaeb1
22 changed files with 65 additions and 47 deletions
|
@ -20,10 +20,9 @@ from simplipy.websocket import (
|
|||
)
|
||||
|
||||
from homeassistant.components.alarm_control_panel import (
|
||||
FORMAT_NUMBER,
|
||||
FORMAT_TEXT,
|
||||
AlarmControlPanelEntity,
|
||||
AlarmControlPanelEntityFeature,
|
||||
CodeFormat,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
|
@ -130,9 +129,9 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity):
|
|||
|
||||
if code := self._simplisafe.entry.options.get(CONF_CODE):
|
||||
if code.isdigit():
|
||||
self._attr_code_format = FORMAT_NUMBER
|
||||
self._attr_code_format = CodeFormat.NUMBER
|
||||
else:
|
||||
self._attr_code_format = FORMAT_TEXT
|
||||
self._attr_code_format = CodeFormat.TEXT
|
||||
|
||||
self._last_event = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue