Skip to content

Commit fc8f8b3

Browse files
authored
2 parents ee05adf + ec09180 commit fc8f8b3

File tree

92 files changed

+1492
-423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1492
-423
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

homeassistant/components/awair/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"documentation": "https://www.home-assistant.io/integrations/awair",
77
"iot_class": "local_polling",
88
"loggers": ["python_awair"],
9-
"requirements": ["python-awair==0.2.4"],
9+
"requirements": ["python-awair==0.2.5"],
1010
"zeroconf": [
1111
{
1212
"name": "awair*",

homeassistant/components/cloud/__init__.py

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from datetime import datetime, timedelta
88
from enum import Enum
99
import logging
10-
from typing import cast
10+
from typing import Any, cast
1111

1212
from hass_nabucasa import Cloud
1313
import voluptuous as vol
@@ -85,6 +85,10 @@
8585
"CLOUD_CONNECTION_STATE"
8686
)
8787

88+
_SIGNAL_CLOUDHOOKS_UPDATED: SignalType[dict[str, Any]] = SignalType(
89+
"CLOUDHOOKS_UPDATED"
90+
)
91+
8892
STARTUP_REPAIR_DELAY = 1 # 1 hour
8993

9094
ALEXA_ENTITY_SCHEMA = vol.Schema(
@@ -240,6 +244,24 @@ async def async_delete_cloudhook(hass: HomeAssistant, webhook_id: str) -> None:
240244
await hass.data[DATA_CLOUD].cloudhooks.async_delete(webhook_id)
241245

242246

247+
@callback
248+
def async_listen_cloudhook_change(
249+
hass: HomeAssistant,
250+
webhook_id: str,
251+
on_change: Callable[[dict[str, Any] | None], None],
252+
) -> Callable[[], None]:
253+
"""Listen for cloudhook changes for the given webhook and notify when modified or deleted."""
254+
255+
@callback
256+
def _handle_cloudhooks_updated(cloudhooks: dict[str, Any]) -> None:
257+
"""Handle cloudhooks updated signal."""
258+
on_change(cloudhooks.get(webhook_id))
259+
260+
return async_dispatcher_connect(
261+
hass, _SIGNAL_CLOUDHOOKS_UPDATED, _handle_cloudhooks_updated
262+
)
263+
264+
243265
@bind_hass
244266
@callback
245267
def async_remote_ui_url(hass: HomeAssistant) -> str:
@@ -287,7 +309,7 @@ async def _shutdown(event: Event) -> None:
287309

288310
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _shutdown)
289311

290-
_remote_handle_prefs_updated(cloud)
312+
_handle_prefs_updated(hass, cloud)
291313
_setup_services(hass, prefs)
292314

293315
async def async_startup_repairs(_: datetime) -> None:
@@ -371,26 +393,32 @@ async def _on_initialized() -> None:
371393

372394

373395
@callback
374-
def _remote_handle_prefs_updated(cloud: Cloud[CloudClient]) -> None:
375-
"""Handle remote preferences updated."""
376-
cur_pref = cloud.client.prefs.remote_enabled
396+
def _handle_prefs_updated(hass: HomeAssistant, cloud: Cloud[CloudClient]) -> None:
397+
"""Register handler for cloud preferences updates."""
398+
cur_remote_enabled = cloud.client.prefs.remote_enabled
399+
cur_cloudhooks = cloud.client.prefs.cloudhooks
377400
lock = asyncio.Lock()
378401

379-
# Sync remote connection with prefs
380-
async def remote_prefs_updated(prefs: CloudPreferences) -> None:
381-
"""Update remote status."""
382-
nonlocal cur_pref
402+
async def on_prefs_updated(prefs: CloudPreferences) -> None:
403+
"""Handle cloud preferences updates."""
404+
nonlocal cur_remote_enabled
405+
nonlocal cur_cloudhooks
383406

407+
# Lock protects cur_ state variables from concurrent updates
384408
async with lock:
385-
if prefs.remote_enabled == cur_pref:
409+
if cur_cloudhooks != prefs.cloudhooks:
410+
cur_cloudhooks = prefs.cloudhooks
411+
async_dispatcher_send(hass, _SIGNAL_CLOUDHOOKS_UPDATED, cur_cloudhooks)
412+
413+
if prefs.remote_enabled == cur_remote_enabled:
386414
return
387415

388-
if cur_pref := prefs.remote_enabled:
416+
if cur_remote_enabled := prefs.remote_enabled:
389417
await cloud.remote.connect()
390418
else:
391419
await cloud.remote.disconnect()
392420

393-
cloud.client.prefs.async_listen_updates(remote_prefs_updated)
421+
cloud.client.prefs.async_listen_updates(on_prefs_updated)
394422

395423

396424
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

homeassistant/components/cync/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from homeassistant.core import HomeAssistant
1010
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
1111
from homeassistant.helpers.aiohttp_client import async_get_clientsession
12+
from homeassistant.util.ssl import get_default_context
1213

1314
from .const import (
1415
CONF_AUTHORIZE_STRING,
@@ -31,9 +32,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: CyncConfigEntry) -> bool
3132
expires_at=entry.data[CONF_EXPIRES_AT],
3233
)
3334
cync_auth = Auth(async_get_clientsession(hass), user=user_info)
35+
ssl_context = get_default_context()
3436

3537
try:
36-
cync = await Cync.create(cync_auth)
38+
cync = await Cync.create(
39+
auth=cync_auth,
40+
ssl_context=ssl_context,
41+
)
3742
except AuthFailedError as ex:
3843
raise ConfigEntryAuthFailed("User token invalid") from ex
3944
except CyncError as ex:

homeassistant/components/decora_wifi/light.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from datetime import timedelta
56
import logging
67
from typing import Any
78

@@ -25,6 +26,7 @@
2526
from homeassistant.helpers import config_validation as cv
2627
from homeassistant.helpers.entity_platform import AddEntitiesCallback
2728
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
29+
from homeassistant.util import Throttle
2830

2931
_LOGGER = logging.getLogger(__name__)
3032

@@ -167,6 +169,7 @@ def turn_off(self, **kwargs: Any) -> None:
167169
except ValueError:
168170
_LOGGER.error("Failed to turn off myLeviton switch")
169171

172+
@Throttle(timedelta(seconds=30))
170173
def update(self) -> None:
171174
"""Fetch new state data for this switch."""
172175
try:

homeassistant/components/dlna_dmr/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"documentation": "https://www.home-assistant.io/integrations/dlna_dmr",
99
"iot_class": "local_push",
1010
"loggers": ["async_upnp_client"],
11-
"requirements": ["async-upnp-client==0.45.0", "getmac==0.9.5"],
11+
"requirements": ["async-upnp-client==0.46.0", "getmac==0.9.5"],
1212
"ssdp": [
1313
{
1414
"deviceType": "urn:schemas-upnp-org:device:MediaRenderer:1",

homeassistant/components/dlna_dms/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": ["ssdp"],
88
"documentation": "https://www.home-assistant.io/integrations/dlna_dms",
99
"iot_class": "local_polling",
10-
"requirements": ["async-upnp-client==0.45.0"],
10+
"requirements": ["async-upnp-client==0.46.0"],
1111
"ssdp": [
1212
{
1313
"deviceType": "urn:schemas-upnp-org:device:MediaServer:1",

homeassistant/components/frontend/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
"documentation": "https://www.home-assistant.io/integrations/frontend",
2121
"integration_type": "system",
2222
"quality_scale": "internal",
23-
"requirements": ["home-assistant-frontend==20251105.0"]
23+
"requirements": ["home-assistant-frontend==20251105.1"]
2424
}

homeassistant/components/go2rtc/__init__.py

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -60,35 +60,6 @@
6060
_LOGGER = logging.getLogger(__name__)
6161

6262
_FFMPEG = "ffmpeg"
63-
_SUPPORTED_STREAMS = frozenset(
64-
(
65-
"bubble",
66-
"dvrip",
67-
"expr",
68-
_FFMPEG,
69-
"gopro",
70-
"homekit",
71-
"http",
72-
"https",
73-
"httpx",
74-
"isapi",
75-
"ivideon",
76-
"kasa",
77-
"nest",
78-
"onvif",
79-
"roborock",
80-
"rtmp",
81-
"rtmps",
82-
"rtmpx",
83-
"rtsp",
84-
"rtsps",
85-
"rtspx",
86-
"tapo",
87-
"tcp",
88-
"webrtc",
89-
"webtorrent",
90-
)
91-
)
9263

9364
CONFIG_SCHEMA = vol.Schema(
9465
{
@@ -197,6 +168,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: Go2RtcConfigEntry) -> bo
197168
return False
198169

199170
provider = entry.runtime_data = WebRTCProvider(hass, url, session, client)
171+
await provider.initialize()
200172
entry.async_on_unload(async_register_webrtc_provider(hass, provider))
201173
return True
202174

@@ -228,16 +200,21 @@ def __init__(
228200
self._session = session
229201
self._rest_client = rest_client
230202
self._sessions: dict[str, Go2RtcWsClient] = {}
203+
self._supported_schemes: set[str] = set()
231204

232205
@property
233206
def domain(self) -> str:
234207
"""Return the integration domain of the provider."""
235208
return DOMAIN
236209

210+
async def initialize(self) -> None:
211+
"""Initialize the provider."""
212+
self._supported_schemes = await self._rest_client.schemes.list()
213+
237214
@callback
238215
def async_is_supported(self, stream_source: str) -> bool:
239216
"""Return if this provider is supports the Camera as source."""
240-
return stream_source.partition(":")[0] in _SUPPORTED_STREAMS
217+
return stream_source.partition(":")[0] in self._supported_schemes
241218

242219
async def async_handle_async_webrtc_offer(
243220
self,

homeassistant/components/go2rtc/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
DEBUG_UI_URL_MESSAGE = "Url and debug_ui cannot be set at the same time."
77
HA_MANAGED_API_PORT = 11984
88
HA_MANAGED_URL = f"http://localhost:{HA_MANAGED_API_PORT}/"
9-
RECOMMENDED_VERSION = "1.9.11"
9+
RECOMMENDED_VERSION = "1.9.12"

0 commit comments

Comments
 (0)