Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'fanc' when using diffuser.is_on #2

Open
smitec11 opened this issue May 12, 2022 · 1 comment
Open

KeyError: 'fanc' when using diffuser.is_on #2

smitec11 opened this issue May 12, 2022 · 1 comment

Comments

@smitec11
Copy link

smitec11 commented May 12, 2022

Milan,

can you check this,

diffuser.is_on is giving error :

traceback (most recent call last):
File "/home/pi/scripts/genie.py", line 33, in
run(main())
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/pi/scripts/genie.py", line 28, in main
print(f'stat: : {diffuser.is_on}')
File "/home/pi/.local/lib/python3.9/site-packages/pyrituals/init.py", line 71, in is_on
return self.hub_data["attributes"]["fanc"] == "1"
KeyError: 'fanc'

when i use the example, and add the 'diffuser.is_on'

(diffuser.perfume_amount is also not working)

i am using python3.9 on rpi4 bullseye

regards,
Chris

@milanmeu
Copy link
Owner

milanmeu commented Jun 11, 2022

Hi @smitec11, sorry for my late response.

Please see https://github.com/milanmeu/pyrituals#diffuser-data:

Some properties require data that is only available after executing update_data().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants