gnomecast
gnomecast copied to clipboard
AttributeError: 'Chromecast' object has no attribute 'device'
Hi,
Using Fedora 35, I get following messages when gnomecast try to find chromecast.
chromium-freeworld-96.0.4664.45-1.fc35.x86_64 find the chromecast and casts on it with no problem.
Environment:
Fedora 35 gnomecast 1.9.11 python3-chromecast-9.3.1-1.fc35.noarch
Messages:
$ gnomecast update_button_visible None update_button_visible update_button_visible serving on http://192.168.1.11:55281 check_ffmpeg b'/usr/bin/ffmpeg\n' Traceback (most recent call last): File "/home/didier/.local/lib/python3.10/site-packages/gnomecast.py", line 566, in f friendly_name = cc.device.friendly_name AttributeError: 'Chromecast' object has no attribute 'device' $
Ubuntu 21.10 The same error after
pip install PyChromecast==1.0.3 zeroconf==0.19.1
restart and the problem resolved for me.
Ubuntu 21.10 The same error after
pip install PyChromecast==1.0.3 zeroconf==0.19.1
restart and the problem resolved for me.
This worked for me as well on Xubuntu 20.04 and Python 3.8.10.
In Fedora 35, I installed python3-chromecast and its pre and co-requisites:
python3-protobuf-3.14.0-6.fc35.noarch python3-ifaddr-0.1.7-5.fc35.noarch python3-zeroconf-0.36.9-1.fc35.noarch python3-casttube-0.2.1-4.fc35.noarch python3-chromecast-9.3.1-1.fc35.noarch
After installation I have installed:
$ pip3 list
Package Version
-------------------- ------------
---/---
PyChromecast 10.1.1
---/---
zeroconf 0.37.0
and I get error above.
The issue is that PyChromecast dropped the device
property in release 10.0, 25 days ago. See https://github.com/home-assistant-libs/pychromecast/releases/tag/10.0.0 and https://github.com/home-assistant-libs/pychromecast/pull/556. All that stuff is now in cast_info
instead.
So the easy fix is to set pychromecast<10
in requirements.txt
and cut a release, then actually fix it and start depending on pychromecast>10,<11
.
Ubuntu 21.10 The same error after
pip install PyChromecast==1.0.3 zeroconf==0.19.1
restart and the problem resolved for me.
Helped me too. Thanks.
The issue is that PyChromecast dropped the
device
property in release 10.0, 25 days ago. See https://github.com/home-assistant-libs/pychromecast/releases/tag/10.0.0 and home-assistant-libs/pychromecast#556. All that stuff is now incast_info
instead.So the easy fix is to set
pychromecast<10
inrequirements.txt
and cut a release, then actually fix it and start depending onpychromecast>10,<11
.
Now the problem is identified can we hope to have a new version of gnomecast who fix it ?
This should fix it: https://github.com/vanadinit/gnomecast/commit/151b53bd4ca183c291b5b8f98ae83cb38745081a
Feel free to cherry-pick or copy the changes.
I am going to fix various things in my fork to get this going for my own setup. Maybe I make a pull-request back to this, but I am not sure how to handle invasive changes, it will be more a rewrite than little adjustments.
Edit: Just discovered that you need also the two cc.name
lines from https://github.com/vanadinit/gnomecast/commit/a1de1aea952422b7edb03884d5bf4746c23b658a
I created a PR with the changes that are the same as the two commits @vanadinit mentioned, hopefully they will merge it.
I created a PR with the changes that are the same as the two commits @vanadinit mentioned, hopefully they will merge it.
Do you plan to merge this PR ?
Used:
pip install PyChromecast==1.0.3 zeroconf==0.19.1
no restart and the problem resolved for me.
This worked. Ubuntu 22.04 and Python 3.10
I created a PR with the changes that are the same as the two commits @vanadinit mentioned, hopefully they will merge it.
Do you plan to merge this PR ?
The problem was fixed, the current master branch detects the device successfully
I created a PR with the changes that are the same as the two commits @vanadinit mentioned, hopefully they will merge it.
Do you plan to merge this PR ?
The problem was fixed, the current master branch detects the device successfully
Had problem indicated in this thread (in Nov, 2022) and used the indicated fix to resolve it.
Perhaps the fix wasn't tested with the original Nvidia Shield and has some edge cases, I don't know.
Got error, found fix, fix worked.
Error exists in software. (sorry)
I just tried the workaround (PyChromecast==1.0.3 zeroconf==0.19.1) and Gnomecast does not launch anymore:
Traceback (most recent call last):
File "/home/legz/.local/bin/gnomecast", line 8, in <module>
sys.exit(main())
File "/home/legz/.local/lib/python3.8/site-packages/gnomecast.py", line 1570, in main
caster = Gnomecast()
File "/home/legz/.local/lib/python3.8/site-packages/gnomecast.py", line 400, in __init__
self.app = bottle.Bottle()
NameError: name 'bottle' is not defined
I applied the fix suggested in the PR, and everything works fine. Thanks @stele95 !
Same problem here 22.04.03 Mate 1.26.0 Gnomecast 1.9.11
Traceback (most recent call last): File "/home/jorgeat/.local/lib/python3.10/site-packages/gnomecast.py", line 1365, in on_cast_combo_changed self.get_nonlocal_cast() File "/home/jorgeat/.local/lib/python3.10/site-packages/gnomecast.py", line 1350, in get_nonlocal_cast cast = pychromecast.Chromecast(text) File "/home/jorgeat/.local/lib/python3.10/site-packages/pychromecast/init.py", line 269, in init if not cast_info.cast_type: AttributeError: 'str' object has no attribute 'cast_type'