freitdav / BDRthermostatHA

BDR (Baxi, De Dietrich, Remeha) thermostat custom component integration for Home Assistant
GNU General Public License v3.0
48 stars 20 forks source link

HA update 2023.5 breaks integration #42

Open jeroenvdd opened 1 year ago

jeroenvdd commented 1 year ago

Something in the latest update breaks the integration, when rolling back to previous it works again

the error in the log: Error setting up entry BDR Thermostat for bdr_thermostat Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/bdr_thermostat/__init__.py", line 62, in async_setup_entry hass.config_entries.async_setup_platforms(config_entry, PLATFORMS) AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

schinddo commented 1 year ago

43 This one is working for me. Just changed the line with the File Editor.

jeroenvdd commented 1 year ago

43 This one is working for me. Just changed the line with the File Editor.

I edited the file in vi, rebooted HA and my bdr is up and running again! thx alot dude

111lisu commented 1 year ago

I also modified custom_components/bdr_thermostat/init.py thx

phoxy84 commented 1 year ago

So only change line 62: hass.config_entries.async_setup_platforms(config_entry, PLATFORMS)

to hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

right?

jeroenvdd commented 1 year ago

So only change line 62: hass.config_entries.async_setup_platforms(config_entry, PLATFORMS)

to hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

right?

yes but add the await command too and give your HA a reboot and it works again :)

phoxy84 commented 1 year ago

don’t know why but sensors are all unavailable. Integration is loading, but no sensors.

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/bdr_thermostat/BdrAPI.py:175 
Integration: BDR Thermostat (documentation) 
First occurred: 15:28:32 (1 occurrences) 
Last logged: 15:28:32

Error setting up entry BDR Thermostat for bdr_thermostat
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/bdr_thermostat/__init__.py", line 59, in async_setup_entry
    await api.bootstrap()
  File "/config/custom_components/bdr_thermostat/BdrAPI.py", line 49, in bootstrap
    await self._load_capabilities()
  File "/config/custom_components/bdr_thermostat/BdrAPI.py", line 175, in _load_capabilities
    for function, uri in subsystem.items():
AttributeError: 'list' object has no attribute 'items'

IMG_4701

schinddo commented 1 year ago

Please check, that you not forgot the await before hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

phoxy84 commented 1 year ago

Can you please post the lines? I uploaded mine in the post before.

thanks

schinddo commented 1 year ago

Change line 62 from:

hass.config_entries.async_setup_platforms(config_entry, PLATFORMS)

to

await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)

phoxy84 commented 1 year ago

Oke, thanks for the quick help.

i tried to make two lines and the old line 62 is now 63. On 62 i only put ‘await’ with an single space in front. Now not integration is not loading. Tried with and without the space in front of await.

but with await on the same line (62) it works. Thanks for the help.

I misread i think, on my phone screen the line is cut :)

Marck commented 1 year ago

I have also fixed this https://github.com/freitdav/BDRthermostatHA/pull/43, https://github.com/freitdav/BDRthermostatHA/pull/40 and some other small changes in my fork. You can use that if you want (or fork that): https://github.com/Marck/BDRthermostatHA At the time being a few sensors are not working so those are disabled

111lisu commented 1 year ago

Too bad it doesn't work: sensor.bdr_thermostat_status