Skip to content

Commit

Permalink
Fix KeyError: 'switches' #79
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Jun 21, 2020
1 parent 40c9b88 commit 0c24e4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/sonoff/sonoff_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async def check_offline(self, deviceid: str):
async def send(self, deviceid: str, data: dict, sequence: str, timeout=5):
device: dict = self._devices[deviceid]

if device['uiid'] == 'fan_light':
if device['uiid'] == 'fan_light' and 'switches' in data:
data = ifan02to03(data)

# cmd for D1 and RF Bridge 433
Expand Down

0 comments on commit 0c24e4d

Please sign in to comment.