-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
First off, let's start off with displaying my code:
import sonoff
username = "usrname"
password = "pass"
api_region = "region"
s = sonoff.Sonoff(username, password, api_region)
devices = s.get_devices()
print(devices)
if devices:
# We found a device, lets turn something on
device_id = devices[0]['device id']
s.switch('on', device_id, None)This code was copied straight from the example, and modified to drop config, since it was making trouble on my end.
After running this, I get quite the abnormal error from the code.
Exception has occurred: KeyError
'at'
After delving into the source of this library, I found the exact line from where the exception originates.
Line 123: self._bearer_token = resp['at']

I have absolutely no idea how to fix this, as I am not willing to make modifications to a library I don't understand, unless guided by someone who does.
If anyone can lend a hand with this, you'd have my sincere gratitude.
chrisboyle and ardu1na
Metadata
Metadata
Assignees
Labels
No labels