mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Bump rtsp_to_webrtc to 0.4.0 (#63359)
This commit is contained in:
parent
5140c1fa6a
commit
9c166dfff2
@ -21,8 +21,9 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
from rtsp_to_webrtc.client import Client
|
from rtsp_to_webrtc.client import get_adaptive_client
|
||||||
from rtsp_to_webrtc.exceptions import ClientError, ResponseError
|
from rtsp_to_webrtc.exceptions import ClientError, ResponseError
|
||||||
|
from rtsp_to_webrtc.interface import WebRTCClientInterface
|
||||||
|
|
||||||
from homeassistant.components import camera
|
from homeassistant.components import camera
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -42,10 +43,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
"""Set up RTSPtoWebRTC from a config entry."""
|
"""Set up RTSPtoWebRTC from a config entry."""
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
|
|
||||||
client = Client(async_get_clientsession(hass), entry.data[DATA_SERVER_URL])
|
client: WebRTCClientInterface
|
||||||
try:
|
try:
|
||||||
async with async_timeout.timeout(TIMEOUT):
|
async with async_timeout.timeout(TIMEOUT):
|
||||||
await client.heartbeat()
|
client = await get_adaptive_client(
|
||||||
|
async_get_clientsession(hass), entry.data[DATA_SERVER_URL]
|
||||||
|
)
|
||||||
except ResponseError as err:
|
except ResponseError as err:
|
||||||
raise ConfigEntryNotReady from err
|
raise ConfigEntryNotReady from err
|
||||||
except (TimeoutError, ClientError) as err:
|
except (TimeoutError, ClientError) as err:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "RTSPtoWebRTC",
|
"name": "RTSPtoWebRTC",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/rtsp_to_webrtc",
|
"documentation": "https://www.home-assistant.io/integrations/rtsp_to_webrtc",
|
||||||
"requirements": ["rtsp-to-webrtc==0.2.7"],
|
"requirements": ["rtsp-to-webrtc==0.4.0"],
|
||||||
"dependencies": ["camera"],
|
"dependencies": ["camera"],
|
||||||
"codeowners": [
|
"codeowners": [
|
||||||
"@allenporter"
|
"@allenporter"
|
||||||
|
@ -2114,7 +2114,7 @@ rpi-bad-power==0.1.0
|
|||||||
# rpi-rf==0.9.7
|
# rpi-rf==0.9.7
|
||||||
|
|
||||||
# homeassistant.components.rtsp_to_webrtc
|
# homeassistant.components.rtsp_to_webrtc
|
||||||
rtsp-to-webrtc==0.2.7
|
rtsp-to-webrtc==0.4.0
|
||||||
|
|
||||||
# homeassistant.components.russound_rnet
|
# homeassistant.components.russound_rnet
|
||||||
russound==0.1.9
|
russound==0.1.9
|
||||||
|
@ -1279,7 +1279,7 @@ roonapi==0.0.38
|
|||||||
rpi-bad-power==0.1.0
|
rpi-bad-power==0.1.0
|
||||||
|
|
||||||
# homeassistant.components.rtsp_to_webrtc
|
# homeassistant.components.rtsp_to_webrtc
|
||||||
rtsp-to-webrtc==0.2.7
|
rtsp-to-webrtc==0.4.0
|
||||||
|
|
||||||
# homeassistant.components.yamaha
|
# homeassistant.components.yamaha
|
||||||
rxv==0.7.0
|
rxv==0.7.0
|
||||||
|
@ -31,6 +31,16 @@ SERVER_URL = "http://127.0.0.1:8083"
|
|||||||
CONFIG_ENTRY_DATA = {"server_url": SERVER_URL}
|
CONFIG_ENTRY_DATA = {"server_url": SERVER_URL}
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
async def webrtc_server() -> None:
|
||||||
|
"""Patch client library to force usage of RTSPtoWebRTC server."""
|
||||||
|
with patch(
|
||||||
|
"rtsp_to_webrtc.client.WebClient.heartbeat",
|
||||||
|
side_effect=rtsp_to_webrtc.exceptions.ResponseError(),
|
||||||
|
):
|
||||||
|
yield
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
async def mock_camera(hass) -> AsyncGenerator[None, None]:
|
async def mock_camera(hass) -> AsyncGenerator[None, None]:
|
||||||
"""Initialize a demo camera platform."""
|
"""Initialize a demo camera platform."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user