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

cast.reboot() does not work #375

Open
surlyhacker opened this issue Jun 21, 2020 · 5 comments
Open

cast.reboot() does not work #375

surlyhacker opened this issue Jun 21, 2020 · 5 comments

Comments

@surlyhacker
Copy link

surlyhacker commented Jun 21, 2020

I tried a variant of the sample code from the README to see if I could reboot a Google Home Mini. Nothing happens when I call reboot() even after waiting several minutes. It still responds to volume commands immediately after calling reboot() too so I am pretty sure it's not rebooting. (it normally has a light and sound pattern that clearly indicates a reboot)

The Home Mini is on firmware 1.46.195690

>>> import time
>>> import pychromecast
>>> chromecasts = pychromecast.get_chromecasts()
>>> [cc.device.friendly_name for cc in chromecasts]
['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight']
>>> cast = next(cc for cc in chromecasts if cc.device.friendly_name == "one")
>>> cast.wait()
>>> print(cast.device)
DeviceStatus(friendly_name='one', model_name='Google Home Mini', manufacturer='Google Inc.', uuid=UUID('redacted'), cast_type='audio')
>>> cast.reboot()
>>> cast.volume_up()
0.5099999964237213
>>> cast.volume_down()
0.40999999046325686
@balloob
Copy link
Collaborator

balloob commented Jun 21, 2020

Wouldn't be surprised if that API has been removed. It's an older one.

@surlyhacker
Copy link
Author

Well elsewhere I've seen research that shows that it seems to need an auth token now, and tried it a bit myself:

See this issue/comment: rithvikvibhu/GHLocalApi#39 (comment)

# curl -Lv --insecure -H Content-Type:application/json --data-raw '{"params":"now"}' https://redacted:8443/setup/reboot
...
> POST /setup/reboot HTTP/1.1
...
< HTTP/1.1 401 Unauthorized

But shouldn't pychromecast throw an error if it receives a 401?

@fhempy
Copy link
Contributor

fhempy commented Jul 5, 2020

It seems that reboot doesn't work at all with the new get_chromecast_from_service usage. Host is always None and therefore it can't connect to the device.

@balloob
Copy link
Collaborator

balloob commented Jul 7, 2020

@emontnemery we should remove that function. With the recent cast changes we are unable to reboot anyway.

@emontnemery
Copy link
Collaborator

Yeah, I'll remove it.

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

No branches or pull requests

4 participants