hon icon indicating copy to clipboard operation
hon copied to clipboard

Fix compatibility with new HA versions

Open ClusterM opened this issue 5 months ago • 10 comments

This PR implements multiple fixes to ensure compatibility with the latest versions of Home Assistant:

  • Thread safety for DataUpdateCoordinator: Update callbacks are now always executed on the Home Assistant event loop, preventing RuntimeError: Detected code that calls async_write_ha_state from a thread other than the event loop. Previously, this threading issue prevented new data from being received and entity updates from working.

  • Correct use of async_forward_entry_setup: Platforms are now set up using await hass.config_entries.async_forward_entry_setup(...) instead of launching them as background tasks, as required by recent Home Assistant core changes.

  • Remove usage of deprecated HomeAssistantType: All type annotations now use HomeAssistant from homeassistant.core, in line with the latest recommendations and deprecations.

These changes address a number of breaking changes introduced in recent and upcoming Home Assistant releases, ensuring this integration continues to work reliably.

Closes #300 (?), #302, #309, #310, partially #303, etc.

ClusterM avatar Jul 17 '25 14:07 ClusterM

Tested and fully works. Thank you!

devhartley avatar Jul 18 '25 20:07 devhartley

Any news about when a release with those changes is going to be released? The project hasn't been maintained in the last months and I'm considering if it's better just create a fork with those changes

pautena avatar Jul 22 '25 21:07 pautena

+1 for merge - worked to fix compat issues with HA 2025.8

evias avatar Aug 26 '25 07:08 evias

I'm new to home assistant and desperately tried to make this work. Can someone help me update the release I had installed with HACS with this update?

scoofz avatar Sep 14 '25 11:09 scoofz

I'm new to home assistant and desperately tried to make this work. Can someone help me update the release I had installed with HACS with this update?

Use this link to add a custom repository: https://my.home-assistant.io/redirect/hacs_repository/?owner=clusterm&repository=hon&category=integration

ClusterM avatar Sep 17 '25 00:09 ClusterM

Thank you Alexey, Sadly it seems I can't install it for some reason <Integration ClusterM/hon> Downloading ClusterM/hon with version a062567 failed with (Could not download, see log for details) When I check the logs I get the same message ...

scoofz avatar Sep 17 '25 07:09 scoofz

@scoofz for my part I actually applied this PRs changes manually in my custom_components/hon ... but I am using a py venv install of hass, it's probably not the best thing to do, and definitely breaks compatibility with the original hon component.
Maybe that can help. Otherwise I think you would need to uninstall the hon component first, then add the custom repo and install it through that.

evias avatar Sep 17 '25 07:09 evias

Thanks, I did uninstall the previously installed hon component and it's the same thing. I won't be modifying the files for now, I'll wait for a better solution. I tried another repository the other day with a more recent PR than the last official released and I could install it, even if I still couldn't log in either, the current fix wasn't applied on that version, so I think there might be something preventing the download from Alexey's repository... But honestly I don't know jack about anything so...

scoofz avatar Sep 17 '25 07:09 scoofz

Screenshot 2025-10-07 at 11 50 46

@ClusterM Adding it as a custom repository results in 404 as seen in logs above. I think you need to create a release in GitHub for the latest commit, otherwise HACS cannot download the zip .

This official repo is pretty much dead and abandoned, so it's better to migrate

pokonski avatar Oct 07 '25 09:10 pokonski

I have created a fork which can be added to HACS as a custom repository. It has a couple of bugs fixed. Contributions are welcome as well.

Feel free to try it out: https://github.com/mmalolepszy/hon-revived

mmalolepszy avatar Oct 07 '25 12:10 mmalolepszy