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

Partially make pychromecast v7.2.0 compatible #325

Merged
merged 2 commits into from
Aug 6, 2020
Merged

Partially make pychromecast v7.2.0 compatible #325

merged 2 commits into from
Aug 6, 2020

Conversation

piyueh
Copy link
Contributor

@piyueh piyueh commented Aug 6, 2020

My Linux distribution is now providing pychromecast 7.1.1 and higher. So I made some changes to make mkchromecast works with my setting.

Coverage

  1. I only have one Google Home Mini, so I didn't look into video and YouTube streaming. Only checked the audio casting.
  2. I don't use the systray. So not sure if the systray works.
  3. Tested with both pychromecast 7.2.0 and 7.1.0. Didn't go back further.
  4. Tested with Python 3.8.

Changes

Because my use case is very limited, these are small changes. But still, hope this can help some users.

  1. improving --reset by adding get_sink_list and modifying remove_sink:
    If mkchromecast crashed due to some reasons, sometimes the sinks it created were still there. Running with --reset would not kill those residual sinks because mkchromecast.pulseaudio._sink_num is None in this situation. So I added get_sink_list to get related sinks and remove them.

  2. adding dummy reboot to replace pychromecast.dial.reboot when it does not exist:
    Since Remove reboot function home-assistant-libs/pychromecast#394, pychromecast.dial.reboot does not exist anymore. It seems there's currently no alternative way to reboot a device. But just in case rebooting reappears in the future, I didn't modify the existing code in mkchromecast. I simply added a dummy reboot that is doing nothing.

  3. replacing Chromacast.host with Chromecast.socket_client.host:
    Remove host and port from Chromecast object home-assistant-libs/pychromecast#395 removed the host and port attributes under Chromecast objects. But Chromecast.socket_client.host has been a valid attribute since pychromecast v3.0.0. Also, see Chromecast object has None host home-assistant-libs/pychromecast#381 and Report host+port for discovered casts home-assistant-libs/pychromecast#385.

  4. fix the return of pychromecast.get_chromecasts():
    Track services based on UUID instead of mDNS service name home-assistant-libs/pychromecast#380 changed the output of pychromecast.get_chromecasts to a tuple. I believe this is the cause of issue pychromecast 7.1.1-1 breaks mkchromecast #322 .

- bare minimum to only make Linux and audio work; terminal environments
Chromecast.socket_client.host has been valid since at least pychromecast
v3. We can simply replace Chromecast.host with it.
@muammar muammar merged commit 0c72d3d into muammar:master Aug 6, 2020
@stefanhh0 stefanhh0 mentioned this pull request Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants