Fix status exception when no payload
This commit is contained in:
1 parent
d96d02357b
commit
3f854337ad
1 file changed
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user