Skip to content

Commit

Permalink
Fix deprecated _attr_frontend_stream_type
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Nov 27, 2024
1 parent e86bbbe commit 908603e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions custom_components/frigate/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ def __init__(
)

if self._attr_is_streaming:
self._attr_frontend_stream_type = StreamType.WEB_RTC

streaming_template = config_entry.options.get(
CONF_RTSP_URL_TEMPLATE, ""
).strip()
Expand Down Expand Up @@ -277,6 +275,11 @@ def supported_features(self) -> CameraEntityFeature:
return CameraEntityFeature(0)
return CameraEntityFeature.STREAM

@property
def frontend_stream_type(self) -> StreamType | None:
"""Return the type of stream supported by this camera."""
return StreamType.WEB_RTC

async def async_camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
Expand Down Expand Up @@ -382,8 +385,6 @@ def __init__(
self._attr_is_streaming = True
self._attr_is_recording = False

self._attr_frontend_stream_type = StreamType.WEB_RTC

streaming_template = config_entry.options.get(
CONF_RTSP_URL_TEMPLATE, ""
).strip()
Expand Down Expand Up @@ -427,6 +428,11 @@ def supported_features(self) -> CameraEntityFeature:
"""Return supported features of this camera."""
return CameraEntityFeature.STREAM

@property
def frontend_stream_type(self) -> StreamType | None:
"""Return the type of stream supported by this camera."""
return StreamType.WEB_RTC

async def async_camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
Expand Down

0 comments on commit 908603e

Please sign in to comment.