Skip to content

AttributeError: 'Chromecast' object has no attribute 'device' #171

Open

Description

@didierga

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'
$

Activity

  1. Bradara commented on Nov 28, 2021

    @Bradara

    Ubuntu 21.10
    The same error
    after

    pip install PyChromecast==1.0.3 zeroconf==0.19.1

    restart and the problem resolved for me.

  2. beregon87 commented on Dec 5, 2021

    @beregon87

    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.

  3. didierga commented on Dec 6, 2021

    @didierga
    Author

    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.

  4. interfect commented on Dec 10, 2021

    @interfect

    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 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.

  5. michaldrabik commented on Jan 3, 2022

    @michaldrabik

    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.

  6. didierga commented on Jan 11, 2022

    @didierga
    Author

    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 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.

    Now the problem is identified can we hope to have a new version of gnomecast who fix it ?

  7. vanadinit commented on Jan 29, 2022

    @vanadinit

    This should fix it: vanadinit@151b53b

    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 vanadinit@a1de1ae

  8. stele95 commented on Jan 29, 2022

    @stele95

    I created a PR with the changes that are the same as the two commits @vanadinit mentioned, hopefully they will merge it.

  9. didierga commented on Mar 11, 2022

    @didierga
    Author

    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 ?

  10. Senacharim commented on Nov 19, 2022

    @Senacharim

    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

  11. stele95 commented on Nov 27, 2022

    @stele95

    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

  12. Senacharim commented on Nov 27, 2022

    @Senacharim

    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)

  13. legz commented on Jan 2, 2023

    @legz

    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 !

  14. added a commit that references this issue on Apr 11, 2023
  15. JorgeAT227 commented on Sep 13, 2023

    @JorgeAT227

    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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions