Closed helen-fornazier closed 5 years ago
Hello,
I am having the following error when I call s.switch('on', device_id, 0):
s.switch('on', device_id, 0)
Traceback (most recent call last): File "/tmp/test.py", line 14, in <module> 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'
Looking at the device object, I see:
u'params': {u'fwVersion': u'1.6.0', u'rssi': -51, u'staMac': u'68:C6:3A:A3:8B:B4', u'startup': u'off', u'switch': u'off'},
There is no 'switches' key in 'params'
It works if I use s.switch('on', device_id, None) instead
s.switch('on', device_id, None)
It seems that we get that error if the switch is not an outlet type.
Hello,
I am having the following error when I call
s.switch('on', device_id, 0)
:Looking at the device object, I see:
There is no 'switches' key in 'params'