diff options
author | Daniel Høyer Iversen <mail@dahoiv.net> | 2019-06-10T07·12+0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-10T07·12+0200 |
commit | 9ec2da834b2703e1b07bb40452c0b8c148509f60 (patch) | |
tree | ebc09e0427a14e028519f4d63f5fb55f3a5e5132 /broadlink/__init__.py | |
parent | c94838f56140338455b8cc4011d14c24551da50e (diff) |
handle none power raw (#250)
Diffstat (limited to 'broadlink/__init__.py')
-rw-r--r-- | broadlink/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/broadlink/__init__.py b/broadlink/__init__.py index 7a385fc1556e..4f1cc823e668 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) |