check for None state in broadlink (#24589)

This commit is contained in:
Daniel Høyer Iversen 2019-06-19 10:10:38 +02:00 committed by Pascal Vizeli
parent 08e2959742
commit 9413b5a415

View file

@ -322,6 +322,8 @@ class BroadlinkMP1Switch:
def get_outlet_status(self, slot):
"""Get status of outlet from cached status list."""
if self._states is None:
return None
return self._states['s{}'.format(slot)]
@Throttle(TIME_BETWEEN_UPDATES)