Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while setting up teufel_raumfeld platform for media_player #63

Closed
greentux opened this issue Jun 8, 2024 · 10 comments
Closed

Error while setting up teufel_raumfeld platform for media_player #63

greentux opened this issue Jun 8, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@greentux
Copy link

greentux commented Jun 8, 2024

HASS 2024.6
2024-06-08 15:47:33.241 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'teufel_raumfeld' accesses hass.helpers.entity_registry. This is deprecated and will stop working in Hom
e Assistant 2024.11, it should be updated to import functions used from entity_registry directly at custom_components/teufel_raumfeld/media_player.py, line 148: entity_registry = hass.helpers.entity_registry.asyn
c_get(hass), please create a bug report at https://github.com/B5r1oJ0A9G/teufel_raumfeld/issues
2024-06-08 15:47:33.241 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up teufel_raumfeld platform for media_player
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/teufel_raumfeld/media_player.py", line 148, in async_setup_entry
entity_registry = hass.helpers.entity_registry.async_get(hass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: async_get() takes 1 positional argument but 2 were given

and services will be not longer available

Error executing script. Service not found for call_service at pos 5:
Service teufel_raumfeld.abs_volume_set not found

@zwerg1395
Copy link

This has Probably to do with the issue.
Detected that custom integration 'teufel_raumfeld' accesses hass.helpers.entity_registry. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from entity_registry directly at custom_components/teufel_raumfeld/media_player.py, line 148: entity_registry = hass.helpers.entity_registry.async_get(hass), please create a bug report at https://github.com/B5r1oJ0A9G/teufel_raumfeld/issues

@blackmore190
Copy link

blackmore190 commented Jun 17, 2024

Since the warning tells that it will stop work in Home Assistant 2024.11 it should work now. I got some equal errors in my log:
'''
2024-06-17 21:31:05.232 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up teufel_raumfeld platform for media_player
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/teufel_raumfeld/media_player.py", line 148, in async_setup_entry
entity_registry = hass.helpers.entity_registry.async_get(hass)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: async_get() takes 1 positional argument but 2 were given
'''

Is there anybody with this component working on latest Homeassistant? Is it maybe a problem of coding the Umlaut in media_player Names? I have one that is called "Büro" maybe that is the reason to run in some trouble...

@schumi4
Copy link

schumi4 commented Jun 18, 2024

My media_player entity has also vanished from my setup, probably after a HA update. Simply states:
Diese Entität wird nicht mehr von der Integration teufel_raumfeld bereitgestellt.

@zwerg1395
Copy link

Since the warning tells that it will stop work in Home Assistant 2024.11 it should work now. I got some equal errors in my log: ''' 2024-06-17 21:31:05.232 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up teufel_raumfeld platform for media_player Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/teufel_raumfeld/media_player.py", line 148, in async_setup_entry entity_registry = hass.helpers.entity_registry.async_get(hass) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: async_get() takes 1 positional argument but 2 were given '''

Is there anybody with this component working on latest Homeassistant? Is it maybe a problem of coding the Umlaut in media_player Names? I have one that is called "Büro" maybe that is the reason to run in some trouble...

From what i saw from other integrations that had the same issue , as soon as they implemented the new way it worked again , which makes me suspect that they already started with the phase out of the function.

It has nothing to do with the ü because i have the same issue without a Umlaut.

@klausw01
Copy link

klausw01 commented Jun 27, 2024

Hi,

I've no idea if this is a "valid" fix (or workaround) - but here are my changes to /homeassistant/custom_components/teufel_raumfeld/media_player.py: (0.1.15-alpha3)

  1. added new line after line:60
    from homeassistant.helpers.entity_registry import async_get

  2. replaced entity_registry = hass.helpers.entity_registry.async_get(hass) at line:148 (or after adding the code of 1) now line:149)
    with
    entity_registry = async_get(hass)

At least my speakers go "blue" again at the Overview page and the status is playing/paused media is updated ... unfortunately, none of the commands (play/pause/on/off/vol+/vol-/...) are working - but probably it is worth a start :)

After code changes using File Editor Add On a restart of HA is needed.

Update1: Vol+/Vol- is working fine with the slider - but not with the buttons.
Update2: Vol+/Vol- are not working in SingleRoom - in Multiroom configuration (via Teufel Raumfeld App) the buttons are working as well as the song information incl. picture.

@klausw01
Copy link

Find attached my changes based on origin/master

#63_media_player.zip

klausw01 pushed a commit to klausw01/teufel_raumfeld that referenced this issue Jun 28, 2024
…ia_player

Changes to avoid using "hass.helpers.entity_registry" - import entity_registry from homeassistant.helpers and directly use it
@cogelito
Copy link

cogelito commented Jun 28, 2024

I've no idea if this is a "valid" fix (or workaround) - but here are my changes to /homeassistant/custom_components/teufel_raumfeld/media_player.py: (0.1.15-alpha3)

Thank you, that worked for me.

Update1: Vol+/Vol- is working fine with the slider - but not with the buttons. Update2: Vol+/Vol- are not working in SingleRoom - in Multiroom configuration (via Teufel Raumfeld App) the buttons are working as well as the song information incl. picture.

In my case all buttons and sliders seem to work correctly.

@greentux
Copy link
Author

woked completely for all functions?

@cogelito
Copy link

I haven‘t tested single rooms, because I only use multiroom, but that is working flawless again. All buttons and the volume slider are functional and I can switch on/off the single speakers.

B5r1oJ0A9G added a commit that referenced this issue Jul 7, 2024
#63 Error while setting up teufel_raumfeld platform for media_player
@B5r1oJ0A9G
Copy link
Owner

Thanks for reporting this issue! I am closing it since the fix from @klausw01 has been merged and released.
If there is still an issue e.g. with single speakers, then please create a dedicated ticket for that issue.

@B5r1oJ0A9G B5r1oJ0A9G added the bug Something isn't working label Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants