Andre0512 / hon

Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines and air conditioners in 28 languages.
MIT License
1.3k stars 2.46k forks source link

Log warning using async_write_ha_state #243

Open albertinizao opened 2 months ago

albertinizao commented 2 months ago

Is your feature request related to a problem? Please describe. I see a warning recurrent log

WARNING (Dummy-15) [homeassistant.helpers.frame] Detected that custom integration 'hon' calls async_write_ha_state from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_write_ha_state at custom_components/hon/sensor.py, line 849: self.async_write_ha_state(), please report it to the author of the 'hon' custom integration

kubasaw commented 2 months ago

MQTT message handler is running in separated thread, so this warning occur every time message is received.

I'm fixing this (and much more issues) in fork, but at the moment it is quite unstable: https://github.com/IoTLabs-pl/hon

szczukot commented 4 weeks ago

Log from HA: hOn ver 0.14.0.

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:188
First occurred: 9:09:46 AM (42 occurrences)
Last logged: 10:04:34 AM

Detected that custom integration 'hon' calls async_write_ha_state from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#async_write_ha_state at custom_components/hon/sensor.py, line 849: self.async_write_ha_state(), please report it to the author of the 'hon' custom integration
szczukot commented 4 weeks ago

@Andre0512 is this repo is out of date ? And better when we use the new one (@kubasaw etc)?

WladyTee commented 3 weeks ago

Same warnings and errors in my Home Assistant. Should we expect any update? Thanks!