Closed helen-fornazier closed 4 years ago
Using s.switch('on', device_id, 0) didn't work out of the box, it trows the following error:
Traceback (most recent call last): File "/tmp/test.py", line 14, in s.switch('on', device_id, 0) File "/usr/local/lib/python2.7/dist-packages/sonoff/sonoff.py", line 246, in switch params = { 'switches' : device['params']['switches'] } KeyError: 'switches'
Updating the command to s.switch('on', device_id, None) works like a charm
Using s.switch('on', device_id, 0) didn't work out of the box, it trows the following error:
Traceback (most recent call last): File "/tmp/test.py", line 14, in
s.switch('on', device_id, 0)
File "/usr/local/lib/python2.7/dist-packages/sonoff/sonoff.py", line 246, in switch
params = { 'switches' : device['params']['switches'] }
KeyError: 'switches'
Updating the command to s.switch('on', device_id, None) works like a charm