Skip to content

Commit

Permalink
Revert "Prepare for Home Assistant 2024.12"
Browse files Browse the repository at this point in the history
This reverts commit 4c5f47f, as
it should only be merged (and released) once HA 2024 is there.
  • Loading branch information
felipecrs committed Nov 26, 2024
1 parent 4c5f47f commit e47ccc2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 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
from homeassistant.components.camera import Camera, CameraEntityFeature, StreamType
from homeassistant.components.mqtt import async_publish
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_URL
Expand Down Expand Up @@ -189,6 +189,8 @@ 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 @@ -299,7 +301,7 @@ async def async_enable_motion_detection(self) -> None:
False,
)

async def async_handle_async_webrtc_offer(self, offer_sdp: str) -> str | None:
async def async_handle_web_rtc_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 @@ -368,6 +370,8 @@ 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 @@ -431,7 +435,7 @@ async def stream_source(self) -> str | None:
"""Return the source of the stream."""
return self._stream_source

async def async_handle_async_webrtc_offer(self, offer_sdp: str) -> str | None:
async def async_handle_web_rtc_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.12.0b0"
"homeassistant": "2024.11.0"
}
2 changes: 2 additions & 0 deletions tests/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ 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 @@ -126,6 +127,7 @@ 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 e47ccc2

Please sign in to comment.