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

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