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

Early init error #1

Closed
xannor opened this issue Jun 6, 2020 · 3 comments
Closed

Early init error #1

xannor opened this issue Jun 6, 2020 · 3 comments

Comments

@xannor
Copy link

xannor commented Jun 6, 2020

This is a non-serious error as it does not seem to impact the system ,just shows up i nthe logs alot.

`
Log Details (ERROR)
Logger: custom_components.meteobridge
Source: helpers/update_coordinator.py:124
Integration: Meteobridge Datalogger (documentation)
First occurred: 9:12:20 AM (20 occurrences)
Last logged: 8:39:24 PM

Unexpected error fetching meteobridge data: local variable 'sensor_item' referenced before assignment
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 136, in async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 124, in _async_update_data
return await self.update_method()
File "/usr/local/lib/python3.7/site-packages/pymeteobridgeio/client.py", line 61, in get_sensor_data
return await self._sensor_data()
File "/usr/local/lib/python3.7/site-packages/pymeteobridgeio/client.py", line 413, in _sensor_data
return sensor_item
UnboundLocalError: local variable 'sensor_item' referenced before assignment
`

@briis
Copy link
Owner

briis commented Jun 6, 2020

I have never seen this error, and the only way it can occur is if no data is returned from Meteobridge but the connection is till fine.
I have now defined sensor_item before looping through data, to ensure that the variable exist, no matter what. I will release a new version ASAP, where the only change is that it now needs pymeteobridgeio v0.16
Please report back here with the status.

@xannor
Copy link
Author

xannor commented Jun 6, 2020

I no longer see the error on restarts so I say this is fixed.

@briis
Copy link
Owner

briis commented Jun 7, 2020

I will close the issue then. Thanks for reporting it.

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