Skip to content

Commit

Permalink
Merge pull request #785 from felipecrs/prepare-for-2024.12
Browse files Browse the repository at this point in the history
Fix deprecated `frontend_stream_type` overwrite
  • Loading branch information
dermotduffy authored Dec 6, 2024
2 parents e94e43a + a95d327 commit b949761
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 20 deletions.
15 changes: 0 additions & 15 deletions custom_components/frigate/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from homeassistant.components.camera import (
Camera,
CameraEntityFeature,
StreamType,
WebRTCAnswer,
WebRTCSendMessage,
)
Expand Down Expand Up @@ -437,13 +436,6 @@ async def stream_source(self) -> str | None:
class FrigateCameraWebRTC(FrigateCamera):
"""A Frigate camera with WebRTC support."""

# TODO: this property can be removed after this fix is released:
# https://github.com/home-assistant/core/pull/130932/files#diff-75655c0eec1c3e736cad1bdb5627100a4595ece9accc391b5c85343bb998594fR598-R603
@property
def frontend_stream_type(self) -> StreamType | None:
"""Return the type of stream supported by this camera."""
return StreamType.WEB_RTC

async def async_handle_async_webrtc_offer(
self, offer_sdp: str, session_id: str, send_message: WebRTCSendMessage
) -> None:
Expand All @@ -463,13 +455,6 @@ async def async_on_webrtc_candidate(self, session_id: str, candidate: Any) -> No
class BirdseyeCameraWebRTC(BirdseyeCamera):
"""A Frigate birdseye camera with WebRTC support."""

# TODO: this property can be removed after this fix is released:
# https://github.com/home-assistant/core/pull/130932/files#diff-75655c0eec1c3e736cad1bdb5627100a4595ece9accc391b5c85343bb998594fR598-R603
@property
def frontend_stream_type(self) -> StreamType | None:
"""Return the type of stream supported by this camera."""
return StreamType.WEB_RTC

async def async_handle_async_webrtc_offer(
self, offer_sdp: str, session_id: str, send_message: WebRTCSendMessage
) -> None:
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"hacs": "1.6.0",
"name": "Frigate",
"homeassistant": "2024.11.0"
"homeassistant": "2024.12.0"
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ aiohttp
aiohttp_cors
attr
janus
homeassistant==2024.11.3
homeassistant==2024.12.0
paho-mqtt
python-dateutil
yarl
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ flake8
mypy
pre-commit
pytest
pytest-homeassistant-custom-component==0.13.184
pytest-homeassistant-custom-component==0.13.190
pylint-pytest
pylint
pytest-aiohttp
Expand Down
8 changes: 6 additions & 2 deletions tests/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ async def test_frigate_camera_setup_webrtc(
"type": "camera/webrtc/candidate",
"entity_id": TEST_CAMERA_FRONT_DOOR_ENTITY_ID,
"session_id": "session_id",
"candidate": "candidate",
"candidate": {
"candidate": "candidate",
},
}
)

Expand Down Expand Up @@ -293,7 +295,9 @@ async def test_frigate_camera_setup_birdseye_webrtc(
"type": "camera/webrtc/candidate",
"entity_id": TEST_CAMERA_BIRDSEYE_ENTITY_ID,
"session_id": "session_id",
"candidate": "candidate",
"candidate": {
"candidate": "candidate",
},
}
)

Expand Down

0 comments on commit b949761

Please sign in to comment.