From 9ec2da834b2703e1b07bb40452c0b8c148509f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Mon, 10 Jun 2019 09:12:50 +0200 Subject: [PATCH] handle none power raw (#250) --- broadlink/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 7a385fc15..4f1cc823e 100644 --- a/broadlink/__init__.py +++ b/broadlink/__init__.py @@ -357,6 +357,8 @@ class mp1(device): def check_power(self): """Returns the power state of the smart power strip.""" state = self.check_power_raw() + if state is None: + return {'s1': None, 's2': None, 's3': None, 's4': None} data = {} data['s1'] = bool(state & 0x01) data['s2'] = bool(state & 0x02)