dahlb / ha_hatch

Home Assistant Integration for Hatch Rest Mini
MIT License
76 stars 16 forks source link

HA 2024.5.0 deprecation warning #129

Closed Intecpsp closed 2 weeks ago

Intecpsp commented 2 weeks ago
  1. Detected that custom integration 'ha_hatch' calls async_write_ha_state from a thread at custom_components/ha_hatch/rest_media_entity.py, line 77: self.async_write_ha_state(), please report it to the author of the 'ha_hatch' custom integration
  2. Detected that custom integration 'ha_hatch' calls async_write_ha_state from a thread at custom_components/ha_hatch/rest_light_entity.py, line 35: self.async_write_ha_state(), please report it to the author of the 'ha_hatch' custom integration

Looks like it is rotating through the different instances of async_write_ha_state. I've also seen one for switch.py line 41

gullygossner commented 2 weeks ago

Similar issues on my end.

dahlb commented 2 weeks ago

1.17.2 resolves this warning that was caused by the websocket thread updating the home assistant ui directly

Intecpsp commented 2 weeks ago

1.17.2 does not fix this issue

Intecpsp commented 2 weeks ago

I noticed 1.17.2 didn't remove/update the call(s) this error was mentioning. I found this, hope it's helpful.

dahlb commented 2 weeks ago

1.17.3 is updated based on the advice from @Intecpsp, much easier solution :)

Intecpsp commented 2 weeks ago

That seems to have fixed the issue! But the UI seems to be slow to show the changes.

Before this change it didn't update until a page refresh. After this update it seems to update without a refresh, but takes a couple seconds to show the change.

dahlb commented 2 weeks ago

That function call from the article notifies the UI and the UI decides when to update, the warning is part of ongoing work to ensure the one thread that is allowed to interact with the UI in ha isn't deadlocked or starved so I don't think we can rush it. But I'm glad to hear it also fixed an issue for those who use dashboards.

Intecpsp commented 2 weeks ago

I wasn't sure how much control you had there, but everything else looks good. I appreciate your help here!