Remove no-longer-functioning SimpliSafe websocket support (#49876)

* Remove no-longer-functioning SimpliSafe websocket support

* Linting
This commit is contained in:
Aaron Bach 2021-04-29 19:02:45 -06:00 committed by GitHub
parent 38a03009ae
commit 73714eba4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,13 +17,7 @@ from simplipy.websocket import (
)
import voluptuous as vol
from homeassistant.const import (
ATTR_CODE,
CONF_CODE,
CONF_TOKEN,
CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.const import ATTR_CODE, CONF_CODE, CONF_TOKEN, CONF_USERNAME
from homeassistant.core import CoreState, callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import (
@ -454,17 +448,21 @@ class SimpliSafe:
async def async_init(self):
"""Initialize the data class."""
asyncio.create_task(self.websocket.async_connect())
# 2021-04-29: Disabling connection to the websocket due to the SimpliSafe cloud
# removing it (and not providing a clear alternative).
# asyncio.create_task(self.websocket.async_connect())
async def async_websocket_disconnect(_):
"""Define an event handler to disconnect from the websocket."""
await self.websocket.async_disconnect()
# async def async_websocket_disconnect(_):
# """Define an event handler to disconnect from the websocket."""
# await self.websocket.async_disconnect()
self._hass.data[DOMAIN][DATA_LISTENER][self.config_entry.entry_id].append(
self._hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, async_websocket_disconnect
)
)
# 2021-04-29: Disabling disconnection from the websocket due to the SimpliSafe
# cloud removing it (and not providing a clear alternative).
# self._hass.data[DOMAIN][DATA_LISTENER][self.config_entry.entry_id].append(
# self._hass.bus.async_listen_once(
# EVENT_HOMEASSISTANT_STOP, async_websocket_disconnect
# )
# )
self.systems = await self._api.get_systems()
for system in self.systems.values():