shauntarves/wyze-sdk

Unable to create access/refresh token. "<frozen os>" KeyError

Closed this issue · 2 comments

I'm not totally sure what I might be doing wrong. I have copied the code directly from the readme, replaced WYZE_EMAIL and WYZE_PASSWORD with the appropriate information and I am getting this error:

File "PATH/wyze.py", line 5, in
response = Client().login(email=os.environ[WYZE_EMAIL], password=os.environ[WYZE_PASSWORD])
~~~~~~~~~~^^^^^^^^^^^^
File "", line 678, in getitem
KeyError: 'my email address'

Any ideas what would cause this?

Hi @highfidelitygarden,

The example in the README is showing how to do this client login with your email and password stored as environment variables. That is what os.environ['WYZE_EMAIL'] does - it looks in the list of environment variables for the variable named WYZE_EMAIL, which would - presumably - be set to your email address.

If you aren't familiar with how to use environment variables, and you just want to use your email and password directly as strings, you can do something like:

response = Client().login(email='my email address', password='my password')

That solved it thank you!