AlexxIT / StreamAssist

Home Assistant custom component that allows you to turn almost any camera and almost any speaker into a local voice assistant
MIT License
167 stars 13 forks source link

RuntimeError: Detected that custom integration 'stream_assist' calls async_write_ha_state from a thread #28

Open mterry63 opened 1 month ago

mterry63 commented 1 month ago

Home Assistant 2024.5.3 logging error: RuntimeError: Detected that custom integration 'stream_assist' calls async_write_ha_state from a thread at custom_components/stream_assist/sensor.py, line 47: self.async_write_ha_state(). Please report it to the author of the 'stream_assist' custom integration.

Reading about this: It’s likely not a thread safe application, which recently (2024.4.x) is causing HA to crash after the full conversion to python 3.12. You should check it with this process: Discord 40. It is in the general channel of the HA Discord and will tell you if this is integration is writing unsafe thread writes.

I think it’s just updating the async_write_ha_state() to schedule_update_ha_state() since it’s not in an async function.

ADHDSquir commented 1 month ago

I included a fix for this in PR #26