Fix status exception when no payload

This commit is contained in:
Pierre Ståhl
2020-10-21 09:48:13 +02:00
parent d96d02357b
commit 3f854337ad

View File

@@ -426,7 +426,7 @@ class TuyaProtocol(asyncio.Protocol):
async def status(self):
"""Return device status."""
status = await self.exchange(STATUS)
if "dps" in status:
if status and "dps" in status:
self.dps_cache.update(status["dps"])
return self.dps_cache