diff --git a/custom_components/econnect_metronet/alarm_control_panel.py b/custom_components/econnect_metronet/alarm_control_panel.py index dc704fe..e63b928 100644 --- a/custom_components/econnect_metronet/alarm_control_panel.py +++ b/custom_components/econnect_metronet/alarm_control_panel.py @@ -69,7 +69,7 @@ def icon(self): return "hass:shield-home" @property - def state(self): + def alarm_state(self): """Return the state of the device.""" return self._device.state diff --git a/custom_components/econnect_metronet/devices.py b/custom_components/econnect_metronet/devices.py index e8a0cb1..670d645 100644 --- a/custom_components/econnect_metronet/devices.py +++ b/custom_components/econnect_metronet/devices.py @@ -11,7 +11,6 @@ ParseError, ) from homeassistant.components.alarm_control_panel import AlarmControlPanelState -from homeassistant.const import STATE_UNAVAILABLE from requests.exceptions import HTTPError from .const import ( @@ -64,7 +63,7 @@ def __init__(self, connection, config=None): self._sectors_vacation = config.get(CONF_AREAS_ARM_VACATION) or [] # Alarm state - self.state = STATE_UNAVAILABLE + self.state = None def _register_sector(self, entity): """Register a sector entity in the device's internal inventory.""" diff --git a/tests/test_devices.py b/tests/test_devices.py index 3292a90..ef92a1a 100644 --- a/tests/test_devices.py +++ b/tests/test_devices.py @@ -3,7 +3,6 @@ from elmo import query as q from elmo.api.exceptions import CodeError, CredentialError, LockError, ParseError from homeassistant.components.alarm_control_panel import AlarmControlPanelState -from homeassistant.const import STATE_UNAVAILABLE from requests.exceptions import HTTPError from requests.models import Response @@ -34,7 +33,7 @@ def test_device_constructor(client): assert device._sectors_home == [] assert device._sectors_night == [] assert device._sectors_vacation == [] - assert device.state == STATE_UNAVAILABLE + assert device.state is None def test_device_constructor_with_config(client): @@ -58,7 +57,7 @@ def test_device_constructor_with_config(client): assert device._sectors_home == [3, 4] assert device._sectors_night == [1, 2, 3] assert device._sectors_vacation == [5, 3] - assert device.state == STATE_UNAVAILABLE + assert device.state is None def test_device_constructor_with_config_empty(client): @@ -82,7 +81,7 @@ def test_device_constructor_with_config_empty(client): assert device._sectors_home == [] assert device._sectors_night == [] assert device._sectors_vacation == [] - assert device.state == STATE_UNAVAILABLE + assert device.state is None class TestItemInputs: