Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: refresh card based on IDLE or STREAMING state changes #622

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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

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.

2 participants