Closed VDigitall closed 4 years ago
Verified! Thanks @VDigitall for sharing! Having a SSL issue now
Can you provide more information?
Sure, I have 2 sonoff basics. and I'm running:
s = Sonoff("xxx, "yyy", "us") devices = s.get_devices() if devices:
device_id = devices[0]['deviceid']
s.switch('on', device_id, None)
time.sleep(10)
s.switch('off', device_id, None)
This is the stack trace:
/Users/estebanroblesluna/anaconda2/envs/please-smile2/bin/python /Users/estebanroblesluna/disk/code/ps/please-smile/test/sonoff_test.py
Traceback (most recent call last):
File "/Users/estebanroblesluna/disk/code/ps/please-smile/test/sonoff_test.py", line 10, in
Process finished with exit code 1
This is probably a problem with either self-signed certs or expired certs.
export PYTHONHTTPSVERIFY=0
will work around it
Thanks that works
Hey, sorry to reopen the issue, but i'm having the same problem, returned device list is empty, i'm correctly connected. If i try the get request using my bearer_token and the params in your code i'm receiving {"error":400,"msg":"params incomplete"} Thanks for your help
An empty list returns by method get_devices() I found that response from server in method update_devices() return
{"error":400,"msg":"params incomplete"}
Fix: https://github.com/lucien2k/sonoff-python/pull/13