mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Handle scenario where SimpliSafe code is falsey (#53912)
This commit is contained in:
parent
56360feb9a
commit
7518c58806
@ -70,8 +70,8 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanelEntity):
|
||||
"""Initialize the SimpliSafe alarm."""
|
||||
super().__init__(simplisafe, system, "Alarm Control Panel")
|
||||
|
||||
if CONF_CODE in self._simplisafe.config_entry.options:
|
||||
if self._simplisafe.config_entry.options[CONF_CODE].isdigit():
|
||||
if code := self._simplisafe.config_entry.options.get(CONF_CODE):
|
||||
if code.isdigit():
|
||||
self._attr_code_format = FORMAT_NUMBER
|
||||
else:
|
||||
self._attr_code_format = FORMAT_TEXT
|
||||
|
Loading…
x
Reference in New Issue
Block a user