Ignore status updates without datapoints

This commit is contained in:
Pierre Ståhl
2020-10-05 12:04:21 +02:00
committed by rospogrigio
parent b2c4e93a47
commit 5cd76f87ea

View File

@@ -163,10 +163,11 @@ class TuyaDevice(pytuya.TuyaListener):
@callback
def status_updated(self, status):
"""Device updated status."""
self._status.update(status["dps"])
if "dps" in status:
self._status.update(status["dps"])
signal = f"localtuya_{self._config_entry[CONF_DEVICE_ID]}"
async_dispatcher_send(self._hass, signal, self._status)
signal = f"localtuya_{self._config_entry[CONF_DEVICE_ID]}"
async_dispatcher_send(self._hass, signal, self._status)
@callback
def disconnected(self, exc):