* Add a stream_id parameter to the WebRTC provider
Add an additional stream id parameter (effectively, the camera entity id)
to allow updating an existing stream source when the strema changes. This
is useful for stream sources that have expiring URLs, like Nest.
* Redefine the provider using a type
* Use old typing methods for type definintion to pass python3.8 pylint
* Implement a webrtc to rtsp support in camera as a registry
Allow integrations to register a provider that can convert an RTSP stream and WebRTC offer to a WebRTC answer. This is
planned to be used by the RTSPtoWebRTC server integration as an initial pass, but could
support other server implementations as well (or even native implementationf or that matter).
* Fix test bug to improve test covergae and restructure statements
* Add missing call to refresh webrtc providers
* Run provider refresh in parallel since it may send RPCs
* Replace for loop with any
* Fix pylint warning to use a generator
Rename create_stream to async_create_stream in Camera
Rename get_image to async_get_image in Stream
Rename get_image to async_get_image in KeyFrameConverter
* Add a camera specific logger to help diagnose stream errors
Add a camera specific logger to help users associate stream errors with a particular camera.
Issue #54659
* Apply code review feedback
* Update package name based on manual testing
* Mark camera unavailable when keepalive stream fails
Add a listener in stream that notifies camera when the stream state has changed, and
use that to inform the camera `available` property. Update the property to be set
only from the main loop where it is read to reduce thread safety races.
Issue #54659
* Fix pylint import related errors
* Address lint naming errors
* Apply suggestions from code review
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Camera devices may support multiple stream sources so we want to clarify that
this is meant to decide which stream source is used in the frontend only.
Will set stream_type temporarily to allow rollout without breaking nightly,
and this will be removed after frontend is updated.
* Add WebSocket API for intiting a WebRTC stream
See https://github.com/home-assistant/architecture/discussions/640
* Increase test coverage for webrtc camera stream
* Apply suggestions from code review
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>