B5r1oJ0A9G / teufel_raumfeld

Integration for Teufel smart speaker (aka Raumfeld Multiroom) into https://www.home-assistant.io/.
GNU General Public License v3.0
33 stars 7 forks source link

deprecated `async_get_registry` warning #36

Closed balk77 closed 1 year ago

balk77 commented 2 years ago

Hi, I am getting the following error. I have no clue how to fix this; would you please be so kind to fix this?

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:103
First occurred: 19:04:43 (1 occurrences)
Last logged: 19:04:43
Detected integration that uses deprecated `async_get_registry` to access entity registry, use async_get instead. Please report issue to the custom component author for teufel_raumfeld using this method at custom_components/teufel_raumfeld/media_player.py, line 133: entity_registry = await hass.helpers.entity_registry.async_get_registry()
raimundmuc commented 1 year ago

This change leads to the following error for me (and no media_player entities are created):

2023-01-08 19:49:28.816 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up teufel_raumfeld platform for media_player Traceback (most recent call last): File "/home/homeass/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform await asyncio.shield(task) File "/home/homeass/.homeassistant/custom_components/teufel_raumfeld/media_player.py", line 133, in async_setup_entry entity_registry = await hass.helpers.entity_registry.async_get() TypeError: async_get() missing 1 required positional argument: 'hass'

B5r1oJ0A9G commented 1 year ago

Indeed. The corresponding pull request was merged without proper testing. It has been fixed now with v0.1.12-alpha5.