Various fixes

This commit is contained in:
2019-06-27 10:35:33 +02:00
parent 308f6febd2
commit b7eb237632
2 changed files with 13 additions and 6 deletions

View File

@@ -46,7 +46,6 @@ def handle_update(hass, connection, msg):
class BrowserModEntity(Entity):
def __init__(self, hass, deviceID, alias=None):
self._hass = hass
self._deviceID = deviceID
self._alias = alias
self._ws_data = {}
@@ -66,16 +65,19 @@ class BrowserModEntity(Entity):
_LOGGER.error(f"Connecting {self.entity_id}")
self.ws_send("update")
connection.subscriptions[cid] = self.ws_disconnect
self.schedule_update_ha_state()
if self.hass:
self.schedule_update_ha_state()
def ws_disconnect(self):
self._ws_cid = None
self._ws_connection = None
self.schedule_update_ha_state()
if self.hass:
self.schedule_update_ha_state()
def ws_update(self, data):
self._ws_data = data
self.schedule_update_ha_state()
if self.hass:
self.schedule_update_ha_state()
@property
def device_id(self):