Partially make pychromecast v7.2.0 compatible #325
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My Linux distribution is now providing
pychromecast 7.1.1
and higher. So I made some changes to makemkchromecast
works with my setting.Coverage
pychromecast 7.2.0
and7.1.0
. Didn't go back further.Changes
Because my use case is very limited, these are small changes. But still, hope this can help some users.
improving
--reset
by addingget_sink_list
and modifyingremove_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 becausemkchromecast.pulseaudio._sink_num
isNone
in this situation. So I addedget_sink_list
to get related sinks and remove them.adding dummy
reboot
to replacepychromecast.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 inmkchromecast
. I simply added a dummyreboot
that is doing nothing.replacing
Chromacast.host
withChromecast.socket_client.host
:Remove host and port from Chromecast object home-assistant-libs/pychromecast#395 removed the
host
andport
attributes underChromecast
objects. ButChromecast.socket_client.host
has been a valid attribute sincepychromecast 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.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 .