Revert "Add connection lost and restored events"

This reverts commit e7ffe05938.
This commit is contained in:
Aaron Bach
2020-02-04 21:51:33 -07:00
parent e7ffe05938
commit f656ec4e14
5 changed files with 13 additions and 20 deletions

View File

@@ -13,8 +13,6 @@ from simplipy.websocket import (
EVENT_ARMED_HOME,
EVENT_AWAY_EXIT_DELAY_BY_KEYPAD,
EVENT_AWAY_EXIT_DELAY_BY_REMOTE,
EVENT_CONNECTION_LOST,
EVENT_CONNECTION_RESTORED,
EVENT_DISARMED_BY_MASTER_PIN,
EVENT_DISARMED_BY_REMOTE,
EVENT_HOME_EXIT_DELAY,
@@ -177,6 +175,11 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanel):
@callback
def async_update_from_rest_api(self):
"""Update the entity with the provided REST API data."""
if self._system.state == SystemStates.error:
self._online = False
return
self._online = True
if self._system.version == 3:
self._attrs.update(
{
@@ -224,9 +227,7 @@ class SimpliSafeAlarm(SimpliSafeEntity, AlarmControlPanel):
EVENT_HOME_EXIT_DELAY,
):
self._state = STATE_ALARM_ARMING
elif event.event_type == EVENT_CONNECTION_LOST:
self._online = False
elif event.event_type == EVENT_CONNECTION_RESTORED:
self._online = True
else:
self._state = None
self._changed_by = event.changed_by

View File

@@ -3,13 +3,7 @@ import logging
from simplipy.errors import SimplipyError
from simplipy.lock import LockStates
from simplipy.websocket import (
EVENT_CONNECTION_LOST,
EVENT_CONNECTION_RESTORED,
EVENT_LOCK_ERROR,
EVENT_LOCK_LOCKED,
EVENT_LOCK_UNLOCKED,
)
from simplipy.websocket import EVENT_LOCK_ERROR, EVENT_LOCK_LOCKED, EVENT_LOCK_UNLOCKED
from homeassistant.components.lock import LockDevice
from homeassistant.const import STATE_LOCKED, STATE_UNKNOWN, STATE_UNLOCKED
@@ -95,7 +89,5 @@ class SimpliSafeLock(SimpliSafeEntity, LockDevice):
self._state = STATE_UNLOCKED
elif event.event_type == EVENT_LOCK_ERROR:
self._state = STATE_UNKNOWN
elif event.event_type == EVENT_CONNECTION_LOST:
self._online = False
elif event.event_type == EVENT_CONNECTION_RESTORED:
self._online = True
else:
self._state = None

View File

@@ -3,7 +3,7 @@
"name": "SimpliSafe",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/simplisafe",
"requirements": ["simplisafe-python==7.2.0"],
"requirements": ["simplisafe-python==7.1.0"],
"dependencies": [],
"codeowners": ["@bachya"]
}

View File

@@ -1822,7 +1822,7 @@ simplehound==0.3
simplepush==1.1.4
# homeassistant.components.simplisafe
simplisafe-python==7.2.0
simplisafe-python==7.1.0
# homeassistant.components.sisyphus
sisyphus-control==2.2.1

View File

@@ -600,7 +600,7 @@ sentry-sdk==0.13.5
simplehound==0.3
# homeassistant.components.simplisafe
simplisafe-python==7.2.0
simplisafe-python==7.1.0
# homeassistant.components.sleepiq
sleepyq==0.7