mrk-its / homeassistant-blitzortung

Custom Component for fetching lightning data from blitzortung.org
MIT License
186 stars 38 forks source link

Exception in _on_connection_change when dispatching 'blitzortung_mqtt_connected': () #103

Open BJReplay opened 2 months ago

BJReplay commented 2 months ago

I've noticed this error being logged on startup of HA in the last few versions, including 2024.5.3

homeassistant  | 2024-05-11 11:22:52.118 WARNING (SyncWorker_1) [homeassistant.helpers.frame] Detected that custom integration 'blitzortung' calls async_write_ha_state from a thread at custom_components/blitzortung/__init__.py, line 222: sensor.async_write_ha_state(), please report it to the author of the 'blitzortung' custom integration
homeassistant  | 2024-05-11 11:22:52.374 ERROR (SyncWorker_1) [homeassistant.util.logging] Exception in _on_connection_change when dispatching 'blitzortung_mqtt_connected': ()
homeassistant  | Traceback (most recent call last):
homeassistant  |   File "/config/custom_components/blitzortung/__init__.py", line 222, in _on_connection_change
homeassistant  |     sensor.async_write_ha_state()
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1008, in async_write_ha_state
homeassistant  |     self.hass.verify_event_loop_thread("async_write_ha_state")
homeassistant  |   File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
homeassistant  |     frame.report(
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
homeassistant  |     _report_integration(what, integration_frame, level, error_if_integration)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
homeassistant  |     raise RuntimeError(
homeassistant  | RuntimeError: Detected that custom integration 'blitzortung' calls async_write_ha_state from a thread at custom_components/blitzortung/__init__.py, line 222: sensor.async_write_ha_state(). Please report it to the author of the 'blitzortung' custom integration.