Add check for if payload is set on state message
This commit is contained in:
parent
abb8285e2f
commit
ae189ce422
|
|
@ -736,8 +736,9 @@ class TuyaDevice:
|
||||||
await self.update_entity_state_cb()
|
await self.update_entity_state_cb()
|
||||||
|
|
||||||
async def async_update_state(self, state_message, _=None):
|
async def async_update_state(self, state_message, _=None):
|
||||||
_LOGGER.info("Received updated state {}: {}".format(self, self._dps))
|
if state_message.payload and state_message.payload["dps"]:
|
||||||
self._dps.update(state_message.payload["dps"])
|
self._dps.update(state_message.payload["dps"])
|
||||||
|
_LOGGER.info("Received updated state {}: {}".format(self, self._dps))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue