From 3f854337ad9e579f0c1f84b63f9f615601b50d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20St=C3=A5hl?= Date: Wed, 21 Oct 2020 09:48:13 +0200 Subject: [PATCH] Fix status exception when no payload --- custom_components/localtuya/pytuya/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/localtuya/pytuya/__init__.py b/custom_components/localtuya/pytuya/__init__.py index e98020b..0562bdb 100644 --- a/custom_components/localtuya/pytuya/__init__.py +++ b/custom_components/localtuya/pytuya/__init__.py @@ -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