AlexxIT / WebRTC

Home Assistant custom component for real-time viewing of almost any camera stream using WebRTC and other technologies.
https://github.com/AlexxIT/Blog
MIT License
1.54k stars 181 forks source link

WebRTC DashCast not working with HA 2024.3.0 and Chromecast/pycast #664

Closed Cheerpipe closed 8 months ago

Cheerpipe commented 8 months ago

DashCast works OK with HA 2024.2.x but it stopped working with latest update.

Logger: custom_components.webrtc.utils
Source: custom_components/webrtc/utils.py:191
Integration: WebRTC Camera ([documentation](https://github.com/AlexxIT/WebRTC), [issues](https://github.com/AlexxIT/WebRTC/issues))
First occurred: 10:00:50 (1 occurrences)
Last logged: 10:00:50
Can't DashCast to ['media_player.nest_dormitorio']

Traceback (most recent call last):
  File "/config/custom_components/webrtc/utils.py", line 191, in dash_cast
    entity.dashcast.load_url(url, force)
TypeError: DashCastController.load_url() takes 2 positional arguments but 3 were given

Example service call:

service: webrtc.dash_cast
data:
  entity_id: media_player.nest_dormitorio
  entity: camera.frigate_dormitorio_pequeno
  force: true
Cheerpipe commented 8 months ago

I am not a python guy but seems load_url function signatura has changed

image

Cheerpipe commented 8 months ago

Changing line 191 to this seems to do the trick

entity.dashcast.load_url(url, force = force)

Juast added the 'force ='

Won't PR becase don't know if it is the correct way to fix this but hope this helps.

AlexxIT commented 8 months ago

@Cheerpipe this is correct way

NHMikeG commented 8 months ago

Hi - I opened up an issue in Home Assistant for this same issue (https://github.com/home-assistant/core/issues/114310), before I did digging around and found this issue raised within WebRTC.

Sorry if this is a stupid question because I see this is Closed...will this be fixed with a future WebRTC component release?

NHMikeG commented 8 months ago

disregard, I figured it out by manually modifying the utils.py!

AlexxIT commented 7 months ago

https://github.com/AlexxIT/WebRTC/releases/tag/v3.5.2