Skip to content

Conversation

fuatakgun
Copy link
Contributor

@fuatakgun fuatakgun commented Dec 7, 2023

There are some cameras out there which are only streaming intermittently, rather than continuously so WebRTC custom card waits for next reconnect (0 to 30 seconds).

With this PR, webrtc will be forced to refresh itself if the underlying camera entity's state changes into IDLE or STREAMING.

IDLE and STREAMING are defined in home assistant camera entity.

https://github.com/home-assistant/core/blob/dev/homeassistant/components/camera/__init__.py#L96

Looking forward to hearing your feedback.

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 7, 2023

I get the idea what you want to fix. But I don't like the solution. It can have a lot of side effects.

@fuatakgun
Copy link
Contributor Author

Understood, any suggestion?

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 7, 2023

Maybe easiest way to change reconnect timeout via card config for this cameras. Such a thing is not difficult to implement

this.RECONNECT_TIMEOUT = 30000;

@fuatakgun
Copy link
Contributor Author

Works for me, but would it go back to rendering the poster when the stream stops?

@AlexxIT
Copy link
Owner

AlexxIT commented Dec 7, 2023

I don't know. Haven't tested this case. Maybe something should be fixed for this

@ronaldt80
Copy link

Hi, what's the status of this PR? Would be great if this feature can be incorporated.

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

Successfully merging this pull request may close these issues.

3 participants