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

error #38

Closed
chuk-a opened this issue Mar 2, 2023 · 7 comments
Closed

error #38

chuk-a opened this issue Mar 2, 2023 · 7 comments
Assignees

Comments

@chuk-a
Copy link

chuk-a commented Mar 2, 2023

2023-03-03 01:03:17.295 ERROR (MainThread) [homeassistant.components.sensor] worlds_air_quality_index: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 732, in async_device_update
await task
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/worlds_air_quality_index/sensor.py", line 214, in update
if self._resType in self._data['data']['forecast']['daily']:
KeyError: 'forecast'

@pawkakol1
Copy link
Owner

Did you update it?
What HA version do you have?

@pawkakol1
Copy link
Owner

Could you @chuk-a send me your station ID, because I cannot to reproduce it in my HA - I also use Home assistant: 2023.3.0 and World air quality index: V1.0.0.

@pawkakol1 pawkakol1 self-assigned this Mar 2, 2023
@pawkakol1
Copy link
Owner

pawkakol1 commented Mar 2, 2023

I think, I found the solution for you, but I can't to verify it, because my stations work without this fix.
The fixed code is available in "bugFix/forecast" branch:
https://github.com/pawkakol1/worlds-air-quality-index/tree/bugFix/forecast
If you want, you can replace custom_component in your config by custom component from above branch
image

@chuk-a
Copy link
Author

chuk-a commented Mar 3, 2023

hey Pawkakol1,
I am using HA 2023.3. After updating to V1.0.0, it happened with the following stations:
A44098; A368482; A369379

@chuk-a
Copy link
Author

chuk-a commented Mar 3, 2023

I think the problem is related to the Purple air stations.

@pawkakol1
Copy link
Owner

I will check it in today's evening

@pawkakol1
Copy link
Owner

I tested the bug fix with your stations, and it works proper now
https://github.com/pawkakol1/worlds-air-quality-index/releases/tag/v1.0.1

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