schmittx / home-assistant-eero

Eero integration for Home Assistant
MIT License
108 stars 22 forks source link

Use of deprecated `async_get_registry` stops integration from loading #41

Closed pietrouk closed 1 year ago

pietrouk commented 1 year ago

In integrations page shows as: "Failed to set up"

In logs Error setting up entry Eero WiFi for eero 14:41:02 – (ERROR) eero (custom integration) Timeout fetching Eero (xxx) data 14:41:02 – (ERROR) eero (custom integration) Detected integration that uses deprecated async_get_registry to access device registry, use async_get instead. Please report issue to the custom integration author for eero using this method at custom_components/eero/init.py, line 149: device_registry = await hass.helpers.device_registry.async_get_registry() 14:40:51 – (WARNING) helpers/frame.py - message first occurred at 14:40:51 and shows up 2 times

fak316 commented 1 year ago

Same for me. Hasn't worked for a while.

`logger: homeassistant.config_entries Source: custom_components/eero/init.py:333 Integration: eero (documentation, issues) First occurred: 15:33:25 (2 occurrences) Last logged: 15:36:06

Error setting up entry Eero for eero Error setting up entry Asif Khan for eero Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 357, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/eero/init.py", line 333, in async_setup_entry if any([eero.is_eero_beacon for network in coordinator.data.networks for eero in network.eeros]): AttributeError: 'NoneType' object has no attribute 'networks'`

powerbastion commented 1 year ago

Same here. Have to restart Integration every few days.

Logger: homeassistant.helpers.frame Source: helpers/frame.py:77 First occurred: 21 November 2022 at 17:38:00 (2 occurrences) Last logged: 21 November 2022 at 17:38:00

Detected integration that uses deprecated async_get_registry to access device registry, use async_get instead. Please report issue to the custom integration author for eero using this method at custom_components/eero/init.py, line 149: device_registry = await hass.helpers.device_registry.async_get_registry() Detected integration that uses deprecated async_get_registry to access entity registry, use async_get instead. Please report issue to the custom integration author for eero using this method at custom_components/eero/init.py, line 150: entity_registry = await hass.helpers.entity_registry.async_get_registry()

ghost commented 1 year ago

Same here. Bump.. 2023-03-09 22:10:57.348 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses deprecated async_get_registry to access device registry, use async_get instead. Please report issue to the custom integration author for eero using this method at custom_components/eero/init.py, line 149: device_registry = await hass.helpers.device_registry.async_get_registry() 2023-03-09 22:10:57.355 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses deprecated async_get_registry to access entity registry, use async_get instead. Please report issue to the custom integration author for eero using this method at custom_components/eero/init.py, line 150: entity_registry = await hass.helpers.entity_registry.async_get_registry()

BrianSchnieders commented 1 year ago

Same here: Logger: homeassistant.helpers.frame Source: helpers/frame.py:77 First occurred: 10:13:42 PM (2 occurrences) Last logged: 10:13:42 PM

Detected integration that uses deprecated async_get_registry to access device registry, use async_get instead. Please report issue to the custom integration author for eero using this method at custom_components/eero/init.py, line 149: device_registry = await hass.helpers.device_registry.async_get_registry() Detected integration that uses deprecated async_get_registry to access entity registry, use async_get instead. Please report issue to the custom integration author for eero using this method at custom_components/eero/init.py, line 150: entity_registry = await hass.helpers.entity_registry.async_get_registry()

BrianSchnieders commented 1 year ago

@schmittx It seems there is an open PR for this (https://github.com/schmittx/home-assistant-eero/pull/39) Can you verify and merge it to see if it fixes the integration?
Thanks. (I would really like to be able to get to my eero in home assistant) :-)

Holbroser21 commented 1 year ago

@BrianSchnieders

A couple of weeks ago, I browsed the forks of this (here), and was able to find a fix someone else made. I then manually duplicated the changes in the integration directly in my HA system. I think I used the changes in this fork: https://github.com/schmittx/home-assistant-eero/compare/main...marcusds:home-assistant-eero:main

I added and removed the 4x lines there, and it's been working fine ever since.

BrianSchnieders commented 1 year ago

@BrianSchnieders

A couple of weeks ago, I browsed the forks of this (here), and was able to find a fix someone else made. I then manually duplicated the changes in the integration directly in my HA system. I think I used the changes in this fork: main...marcusds:home-assistant-eero:main

I added and removed the 4x lines there, and it's been working fine ever since.

Thanks @Holbroser21 !!! I am new to all this and not a python developer, but I was able to find and make the change. It would still be nice if @schmittx could approve the PR and add it to the main code, so those that are not comfortable with change code themselves can just download the newest version and will start working for them again. :-)

thayerfox commented 1 year ago

I tried the changes in the forks, as well as pull request #39, but they did not work for me. On my version, 2023.5.0, await is not allowed with async_get, and async_setup_platforms is also deprecated. After making these changes, restarting hass and reconfiguring the integration, it started working for me. My changes are in pull request #47.

schmittx commented 1 year ago

Fixed in 1.2.0