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

Fix entity_id param parsing #25

Closed
Jaypeg85 opened this issue Nov 13, 2024 · 7 comments
Closed

Fix entity_id param parsing #25

Jaypeg85 opened this issue Nov 13, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@Jaypeg85
Copy link

Jaypeg85 commented Nov 13, 2024

Hi,

First off - I love this integration!! I use it to cast all my own custom angular dashboards around the house to smart mirrors (with chromecasts attached) and nest hubs.

Yesterday me DashCast integration stopped working. I now get errors in the log like this: AttributeError: 'AppleTvMediaPlayer' object has no attribute '_chromecast' although I'm casting to a chromecast mediaplayer and not an AppleTvMediaPlayer.

  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dash_cast/__init__.py", line 31, in play_media
    chromecast: Chromecast = getattr(entity, "_chromecast")

Any ideas to what is happening?

@AlexxIT AlexxIT added the invalid This doesn't seem right label Nov 13, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Nov 13, 2024

Because this component only for Google Chromecast. And you trying to use it with AppleTV.

@AlexxIT AlexxIT closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2024
@Jaypeg85
Copy link
Author

Jaypeg85 commented Nov 13, 2024

I get that it indeed looks like that, but as i stated this is not the case. I checked multiple times after seeing the log and tried many different nest hubs/chromecasts.
And the GUI in development tools/Action won't even let me choose anything other than the chromecast devices

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 13, 2024

I know GUI should filter all media_players except Chromecast. I don't know how that can happen.

The media player search function is pretty simple. The comparison is based on entity_id.

for entity in hass.data[DATA_INSTANCES]["media_player"].entities:
if entity.entity_id not in entity_ids:
continue
dash: DashCastController = dashs.get(entity.entity_id)
if not dash:
chromecast: Chromecast = getattr(entity, "_chromecast")

Do you have AppleTV? Maybe it's entity_id similar to your chromecast. Or maybe it was similar by default and you have changed it manually?

@Jaypeg85
Copy link
Author

Yea, I can't really figure that out... it stopped working after i readded my HomePods/AppleTVs because they were updated to iOS 18 and the AppleTV integration couldn't handle that apparently. So there have been tinkering with AppleTV's, but I haven't changed the automations where I use dashcast. I'm in the process of removing and readding all chromecasts, to see if that helps

@Jaypeg85
Copy link
Author

Hmm... that didn't change anything. However when i disable the HomePods/AppleTVs it works again. It seems that the homepods named media_player.kids_room interferes with the media_player.kids_room_display for some reason

@AlexxIT AlexxIT added bug Something isn't working and removed invalid This doesn't seem right labels Nov 13, 2024
@AlexxIT AlexxIT reopened this Nov 13, 2024
@AlexxIT AlexxIT self-assigned this Nov 13, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Nov 13, 2024

I will check if this issue related to renaming entity_id.

@AlexxIT AlexxIT changed the title Error when trying to cast Fix entity_id param parsing Dec 8, 2024
AlexxIT added a commit that referenced this issue Dec 8, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Dec 8, 2024

@AlexxIT AlexxIT closed this as completed Dec 8, 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

2 participants