Skip to content

Commit

Permalink
Prepare for Home Assistant 2024.12
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Nov 26, 2024
1 parent 5692b61 commit 4c5f47f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
10 changes: 3 additions & 7 deletions custom_components/frigate/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from yarl import URL

from custom_components.frigate.api import FrigateApiClient
from homeassistant.components.camera import Camera, CameraEntityFeature, StreamType
from homeassistant.components.camera import Camera, CameraEntityFeature
from homeassistant.components.mqtt import async_publish
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_URL
Expand Down Expand Up @@ -189,8 +189,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 @@ -301,7 +299,7 @@ async def async_enable_motion_detection(self) -> None:
False,
)

async def async_handle_web_rtc_offer(self, offer_sdp: str) -> str | None:
async def async_handle_async_webrtc_offer(self, offer_sdp: str) -> str | None:
"""Handle the WebRTC offer and return an answer."""
websession = async_get_clientsession(self.hass)
url = f"{self._url}/api/go2rtc/webrtc?src={self._cam_name}"
Expand Down Expand Up @@ -370,8 +368,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 @@ -435,7 +431,7 @@ async def stream_source(self) -> str | None:
"""Return the source of the stream."""
return self._stream_source

async def async_handle_web_rtc_offer(self, offer_sdp: str) -> str | None:
async def async_handle_async_webrtc_offer(self, offer_sdp: str) -> str | None:
"""Handle the WebRTC offer and return an answer."""
websession = async_get_clientsession(self.hass)
url = f"{self._url}/api/go2rtc/webrtc?src={self._cam_name}"
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.0b0"
}
2 changes: 0 additions & 2 deletions tests/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ async def test_frigate_camera_setup(
assert entity_state
assert entity_state.state == "streaming"
assert entity_state.attributes["supported_features"] == 2
assert entity_state.attributes["frontend_stream_type"] == StreamType.WEB_RTC

source = await async_get_stream_source(hass, TEST_CAMERA_FRONT_DOOR_ENTITY_ID)
assert source
Expand Down Expand Up @@ -127,7 +126,6 @@ async def test_frigate_camera_setup_birdseye(
assert entity_state
assert entity_state.state == "streaming"
assert entity_state.attributes["supported_features"] == 2
assert entity_state.attributes["frontend_stream_type"] == StreamType.WEB_RTC

source = await async_get_stream_source(hass, TEST_CAMERA_BIRDSEYE_ENTITY_ID)
assert source
Expand Down

0 comments on commit 4c5f47f

Please sign in to comment.