home-assistant-libs / pychromecast

Library for Python 3 to communicate with the Google Chromecast.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot initialize 'Chromecast' class

TheonlyIcebear opened this issue · comments

While looking at this issue: #372

I tried using the code here:

import by Chromecast

cast = pychromecast.Chromecast('192.168.0.164')
cast.wait()
print(cast.device)

but then I get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\ekila\AppData\Local\Programs\Python\Python310\lib\site-packages\pychromecast\__init__.py", line 269, in __init__
    if not cast_info.cast_type:
AttributeError: 'str' object has no attribute 'cast_type'

I'm sure this isn't a problem with how I'm using the module and just a general error, that needs fixing. I am also not able to detect any of my Smart TVs with the module. When I got to cast on YouTube I could see all three of them but when this module I couldn't see any of them. Perhaps it's the fact that I have a Wi-Fi card installed into my PC with no antennas, I'm not sure though

I have the same issue

same here :(