andrea-mattioli / bticino_x8000_component

Additional component for home assistant for managing the bticino x8000 smart thermostat without the netatmo firmware.
8 stars 2 forks source link

Broken after hassio core update #33

Open aetasoul opened 1 week ago

aetasoul commented 1 week ago

Checks

The problem

Ciao Andrea, after the last hassio update the integration seems broken:

Error setting up entry Bticino X8000 for bticino_x8000
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/bticino_x8000/__init__.py", line 69, in async_setup_entry
    await webhook_handler.async_register_webhook()
  File "/config/custom_components/bticino_x8000/webhook.py", line 45, in async_register_webhook
    webhook_register(
  File "/usr/src/homeassistant/homeassistant/components/webhook/__init__.py", line 54, in async_register
    raise ValueError("Handler is already defined!")
ValueError: Handler is already defined!

Any idea?

image

Diagnostics information

home-assistant_bticino_x8000_2024-09-19T16-24-04.347Z.log

Anything in the logs that might be useful for me?

Maybe this:

2024-09-17 08:09:43.771 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'bticino_x8000' calls `async_add_job`, which is deprecated and will be removed in Home Assistant 2025.4; Please review https://developers.home-assistant.io/blog/2024/03/13/deprecate_add_run_job for replacement options at custom_components/bticino_x8000/__init__.py, line 59: hass.async_add_job(update_token(None)), please create a bug report at https://github.com/andrea-mattioli/bticino_x8000_component/issues

Additional information

No response

aetasoul commented 1 week ago

Fixed it with this steps:

  1. Open home assistant file editor
  2. Go to folder "custom_components/btcino_x8000/"
  3. Open the file init.py
  4. Replace line 59 ( hass.async_add_job(update_token(None)) ) with hass.async_create_task(update_token(None))
  5. Replace line 72 ( hass.async_add_job ) with hass.async_create_task
  6. Save the file
  7. Full reboot of home assistant
  8. Enjoy