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

No media entity is created #44

Closed
JimboJones3101 opened this issue May 16, 2023 · 4 comments
Closed

No media entity is created #44

JimboJones3101 opened this issue May 16, 2023 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@JimboJones3101
Copy link

Hi there,
it seems that its only me only struggeling with this component :(

I was using this component frequently the last weeks, when all of a sudden it stopped working. I checked HA didnt find nothing, redownloaded the component and reconfigured and figured out that my host is recognised. 2 Devices are recognised (seems correct as I have an Teufel S and Teufel M) but only 6 entities are created. Per device this is :

  • Powerstate
  • Softwareversion
  • Updateinfoversion

No media entity is created, no zone no nothing. I enabled logging and this is the error I'm getting when reloading the integration:

Logger: homeassistant.components.media_player
Source: loader.py:1045
Integration: Media player ([documentation](https://www.home-assistant.io/integrations/media_player), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+media_player%22))
First occurred: 19:59:56 (2 occurrences)
Last logged: 20:04:16

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 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/teufel_raumfeld/media_player.py", line 133, in async_setup_entry
    entity_registry = await hass.helpers.entity_registry.async_get_registry()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1045, in __getattr__
    value = getattr(self._module, attr)
AttributeError: module 'homeassistant.helpers.entity_registry' has no attribute 'async_get_registry'

Anything I can try to get this fixed?

@btittelbach
Copy link

looks like a duplicate of #36

I also currently have troubles with this integration.

@alexludwigklein
Copy link

I experimented a bit and changing line 133 in /config/custom_components/teufel_raumfeld/media_player.py to the following works for me, i.e. media_player entities are created:

entity_registry = hass.helpers.entity_registry.async_get(hass)

@JimboJones3101
Copy link
Author

Hey there,
it was alexludwigklein's comment that fixed the issue for me. For documentation purposes or if anybody else is suffering from the same issue:

For me it was line 134 which was:
entity_registry = await hass.helpers.entity_registry.async_get_registry()

I changed it to:
entity_registry = hass.helpers.entity_registry.async_get(hass)

Thanks again to everyone!

@DonaldGermany
Copy link

I also did this modification as had the same fault. Now entities are back but doesn't show the actual status (e.g. play, pause, title) when done by the Raumfeld app. If music is started by the HA mediaplayer then it does show the status. I still get a fault message, but a different one than before.

Logger: homeassistant.components.sensor
Source: custom_components/teufel_raumfeld/sensor.py:50
Integration: Sensor (documentation, issues)
First occurred: 23:06:54 (1 occurrences)
Last logged: 23:06:54

Error while setting up teufel_raumfeld platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/teufel_raumfeld/sensor.py", line 50, in async_setup_entry
device_name = raumfeld.device_udn_to_name(renderer_udn)
File "/usr/local/lib/python3.10/site-packages/hassfeld/init.py", line 362, in device_udn_to_name
device_name = self.resolve["devudn_to_name"][device_udn]
KeyError: ''

Does anyone have an idea how to make this work again?

@B5r1oJ0A9G B5r1oJ0A9G added the duplicate This issue or pull request already exists label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants