From c3e3a36b4c8deeb59fb4c00ba110ee9f5b69938c Mon Sep 17 00:00:00 2001 From: Avi Miller Date: Thu, 12 Jun 2025 22:32:04 +1000 Subject: [PATCH 01/18] Fix palette handling for LIFX Ceiling SKY effect (#146582) Signed-off-by: Avi Miller --- homeassistant/components/lifx/manager.py | 9 ++++++--- tests/components/lifx/test_light.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/lifx/manager.py b/homeassistant/components/lifx/manager.py index 887bc3c3527..9fae2628f1d 100644 --- a/homeassistant/components/lifx/manager.py +++ b/homeassistant/components/lifx/manager.py @@ -5,7 +5,7 @@ from __future__ import annotations import asyncio from collections.abc import Callable from datetime import timedelta -from typing import Any +from typing import TYPE_CHECKING, Any import aiolifx_effects from aiolifx_themes.painter import ThemePainter @@ -31,9 +31,12 @@ from homeassistant.helpers import config_validation as cv from homeassistant.helpers.service import async_extract_referenced_entity_ids from .const import _ATTR_COLOR_TEMP, ATTR_THEME, DATA_LIFX_MANAGER, DOMAIN -from .coordinator import LIFXUpdateCoordinator, Light +from .coordinator import LIFXUpdateCoordinator from .util import convert_8_to_16, find_hsbk +if TYPE_CHECKING: + from aiolifx.aiolifx import Light + SCAN_INTERVAL = timedelta(seconds=10) SERVICE_EFFECT_COLORLOOP = "effect_colorloop" @@ -426,8 +429,8 @@ class LIFXManager: ) -> None: """Start the firmware-based Sky effect.""" palette = kwargs.get(ATTR_PALETTE) + theme = Theme() if palette is not None: - theme = Theme() for hsbk in palette: theme.add_hsbk(hsbk[0], hsbk[1], hsbk[2], hsbk[3]) diff --git a/tests/components/lifx/test_light.py b/tests/components/lifx/test_light.py index 58843d63f9a..d66908c1b1a 100644 --- a/tests/components/lifx/test_light.py +++ b/tests/components/lifx/test_light.py @@ -843,7 +843,7 @@ async def test_sky_effect(hass: HomeAssistant) -> None: SERVICE_EFFECT_SKY, { ATTR_ENTITY_ID: entity_id, - ATTR_PALETTE: [], + ATTR_PALETTE: None, ATTR_SKY_TYPE: "Clouds", ATTR_CLOUD_SATURATION_MAX: 180, ATTR_CLOUD_SATURATION_MIN: 50, @@ -854,7 +854,7 @@ async def test_sky_effect(hass: HomeAssistant) -> None: bulb.power_level = 65535 bulb.effect = { "effect": "SKY", - "palette": [], + "palette": None, "sky_type": 2, "cloud_saturation_min": 50, "cloud_saturation_max": 180, From e7a88e99f922d027236ba5915aeeec20843c7523 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 12 Jun 2025 12:18:23 +0200 Subject: [PATCH 02/18] Fix fan is_on status in xiaomi_miio (#146592) --- homeassistant/components/xiaomi_miio/fan.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homeassistant/components/xiaomi_miio/fan.py b/homeassistant/components/xiaomi_miio/fan.py index c69bd150226..de2750f3c81 100644 --- a/homeassistant/components/xiaomi_miio/fan.py +++ b/homeassistant/components/xiaomi_miio/fan.py @@ -330,6 +330,12 @@ class XiaomiGenericDevice( """Return the percentage based speed of the fan.""" return None + @property + def is_on(self) -> bool | None: + """Return true if device is on.""" + # Base FanEntity uses percentage to determine if the device is on. + return self._attr_is_on + async def async_turn_on( self, percentage: int | None = None, From f0fc87e2b68222cee91f58f123eddce282759f5d Mon Sep 17 00:00:00 2001 From: Vasilis Valatsos Date: Fri, 13 Jun 2025 18:47:07 +0200 Subject: [PATCH 03/18] Drop HostKeyAlgorithms in aruba (#146619) --- homeassistant/components/aruba/device_tracker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/aruba/device_tracker.py b/homeassistant/components/aruba/device_tracker.py index c2f0d44a6f8..667f2132fc8 100644 --- a/homeassistant/components/aruba/device_tracker.py +++ b/homeassistant/components/aruba/device_tracker.py @@ -89,7 +89,7 @@ class ArubaDeviceScanner(DeviceScanner): def get_aruba_data(self) -> dict[str, dict[str, str]] | None: """Retrieve data from Aruba Access Point and return parsed result.""" - connect = f"ssh {self.username}@{self.host} -o HostKeyAlgorithms=ssh-rsa" + connect = f"ssh {self.username}@{self.host}" ssh: pexpect.spawn[str] = pexpect.spawn(connect, encoding="utf-8") query = ssh.expect( [ From b2bb0aeb64d6eae68832872e5111da03ec56481e Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 12 Jun 2025 22:52:09 +0200 Subject: [PATCH 04/18] Update frontend to 20250531.3 (#146638) --- homeassistant/components/frontend/manifest.json | 2 +- homeassistant/package_constraints.txt | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/frontend/manifest.json b/homeassistant/components/frontend/manifest.json index 4299d2b7503..efb4891debf 100644 --- a/homeassistant/components/frontend/manifest.json +++ b/homeassistant/components/frontend/manifest.json @@ -20,5 +20,5 @@ "documentation": "https://www.home-assistant.io/integrations/frontend", "integration_type": "system", "quality_scale": "internal", - "requirements": ["home-assistant-frontend==20250531.2"] + "requirements": ["home-assistant-frontend==20250531.3"] } diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 57a037f0fb7..64f9d1649a6 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -39,7 +39,7 @@ habluetooth==3.49.0 hass-nabucasa==0.101.0 hassil==2.2.3 home-assistant-bluetooth==1.13.1 -home-assistant-frontend==20250531.2 +home-assistant-frontend==20250531.3 home-assistant-intents==2025.6.10 httpx==0.28.1 ifaddr==0.2.0 diff --git a/requirements_all.txt b/requirements_all.txt index b70c806c1be..43dbc527e51 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1164,7 +1164,7 @@ hole==0.8.0 holidays==0.74 # homeassistant.components.frontend -home-assistant-frontend==20250531.2 +home-assistant-frontend==20250531.3 # homeassistant.components.conversation home-assistant-intents==2025.6.10 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 39fe3779466..7f467760eaa 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1010,7 +1010,7 @@ hole==0.8.0 holidays==0.74 # homeassistant.components.frontend -home-assistant-frontend==20250531.2 +home-assistant-frontend==20250531.3 # homeassistant.components.conversation home-assistant-intents==2025.6.10 From 52c62b31fd5e1fad2da63dad283fa3edef5fb8db Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Thu, 12 Jun 2025 17:24:10 +0300 Subject: [PATCH 05/18] Fix cookies with aiohttp >= 3.12.7 for Vodafone Station (#146647) --- homeassistant/components/vodafone_station/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/vodafone_station/utils.py b/homeassistant/components/vodafone_station/utils.py index 4f900412faf..faa498afdd6 100644 --- a/homeassistant/components/vodafone_station/utils.py +++ b/homeassistant/components/vodafone_station/utils.py @@ -9,5 +9,5 @@ from homeassistant.helpers import aiohttp_client async def async_client_session(hass: HomeAssistant) -> ClientSession: """Return a new aiohttp session.""" return aiohttp_client.async_create_clientsession( - hass, verify_ssl=False, cookie_jar=CookieJar(unsafe=True) + hass, verify_ssl=False, cookie_jar=CookieJar(unsafe=True, quote_cookie=False) ) From 5cd7ea06ad45334e3b1a10b90b19af8864500520 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 13 Jun 2025 15:58:44 +0200 Subject: [PATCH 06/18] Bump wakeonlan to 3.1.0 (#146655) Co-authored-by: J. Nick Koston --- homeassistant/components/samsungtv/entity.py | 4 ++-- homeassistant/components/samsungtv/manifest.json | 2 +- homeassistant/components/wake_on_lan/__init__.py | 2 +- homeassistant/components/wake_on_lan/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/samsungtv/entity.py b/homeassistant/components/samsungtv/entity.py index 1918f6ef28c..2927dcf2683 100644 --- a/homeassistant/components/samsungtv/entity.py +++ b/homeassistant/components/samsungtv/entity.py @@ -76,10 +76,10 @@ class SamsungTVEntity(CoordinatorEntity[SamsungTVDataUpdateCoordinator], Entity) def _wake_on_lan(self) -> None: """Wake the device via wake on lan.""" - send_magic_packet(self._mac, ip_address=self._host) + send_magic_packet(self._mac, ip_address=self._host) # type: ignore[arg-type] # If the ip address changed since we last saw the device # broadcast a packet as well - send_magic_packet(self._mac) + send_magic_packet(self._mac) # type: ignore[arg-type] async def async_turn_off(self, **kwargs: Any) -> None: """Turn the device off.""" diff --git a/homeassistant/components/samsungtv/manifest.json b/homeassistant/components/samsungtv/manifest.json index 5bb69e7f121..dc8133a1b1f 100644 --- a/homeassistant/components/samsungtv/manifest.json +++ b/homeassistant/components/samsungtv/manifest.json @@ -38,7 +38,7 @@ "getmac==0.9.5", "samsungctl[websocket]==0.7.1", "samsungtvws[async,encrypted]==2.7.2", - "wakeonlan==2.1.0", + "wakeonlan==3.1.0", "async-upnp-client==0.44.0" ], "ssdp": [ diff --git a/homeassistant/components/wake_on_lan/__init__.py b/homeassistant/components/wake_on_lan/__init__.py index d68d950e641..b2b2bac6480 100644 --- a/homeassistant/components/wake_on_lan/__init__.py +++ b/homeassistant/components/wake_on_lan/__init__.py @@ -52,7 +52,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ) await hass.async_add_executor_job( - partial(wakeonlan.send_magic_packet, mac_address, **service_kwargs) + partial(wakeonlan.send_magic_packet, mac_address, **service_kwargs) # type: ignore[arg-type] ) hass.services.async_register( diff --git a/homeassistant/components/wake_on_lan/manifest.json b/homeassistant/components/wake_on_lan/manifest.json index c716a851ae4..34e9ccd5d21 100644 --- a/homeassistant/components/wake_on_lan/manifest.json +++ b/homeassistant/components/wake_on_lan/manifest.json @@ -5,5 +5,5 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/wake_on_lan", "iot_class": "local_push", - "requirements": ["wakeonlan==2.1.0"] + "requirements": ["wakeonlan==3.1.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index 43dbc527e51..2e0998a648f 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -3059,7 +3059,7 @@ vultr==0.1.2 # homeassistant.components.samsungtv # homeassistant.components.wake_on_lan -wakeonlan==2.1.0 +wakeonlan==3.1.0 # homeassistant.components.wallbox wallbox==0.9.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 7f467760eaa..07e4bd250d7 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2518,7 +2518,7 @@ vultr==0.1.2 # homeassistant.components.samsungtv # homeassistant.components.wake_on_lan -wakeonlan==2.1.0 +wakeonlan==3.1.0 # homeassistant.components.wallbox wallbox==0.9.0 From 7cf3116f5b3321695f721a8da9f4c26c62b028ea Mon Sep 17 00:00:00 2001 From: Tsvi Mostovicz Date: Thu, 12 Jun 2025 20:29:47 +0300 Subject: [PATCH 07/18] Bump hdate to 1.1.2 (#146659) --- homeassistant/components/jewish_calendar/manifest.json | 2 +- homeassistant/components/jewish_calendar/sensor.py | 10 +++------- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/jewish_calendar/manifest.json b/homeassistant/components/jewish_calendar/manifest.json index 550a6514593..1ab967ecfa4 100644 --- a/homeassistant/components/jewish_calendar/manifest.json +++ b/homeassistant/components/jewish_calendar/manifest.json @@ -6,6 +6,6 @@ "documentation": "https://www.home-assistant.io/integrations/jewish_calendar", "iot_class": "calculated", "loggers": ["hdate"], - "requirements": ["hdate[astral]==1.1.1"], + "requirements": ["hdate[astral]==1.1.2"], "single_config_entry": true } diff --git a/homeassistant/components/jewish_calendar/sensor.py b/homeassistant/components/jewish_calendar/sensor.py index cb38a3797eb..91c618e1c1c 100644 --- a/homeassistant/components/jewish_calendar/sensor.py +++ b/homeassistant/components/jewish_calendar/sensor.py @@ -73,7 +73,7 @@ INFO_SENSORS: tuple[JewishCalendarSensorDescription, ...] = ( translation_key="weekly_portion", device_class=SensorDeviceClass.ENUM, options_fn=lambda _: [str(p) for p in Parasha], - value_fn=lambda results: str(results.after_tzais_date.upcoming_shabbat.parasha), + value_fn=lambda results: results.after_tzais_date.upcoming_shabbat.parasha, ), JewishCalendarSensorDescription( key="holiday", @@ -98,17 +98,13 @@ INFO_SENSORS: tuple[JewishCalendarSensorDescription, ...] = ( key="omer_count", translation_key="omer_count", entity_registry_enabled_default=False, - value_fn=lambda results: ( - results.after_shkia_date.omer.total_days - if results.after_shkia_date.omer - else 0 - ), + value_fn=lambda results: results.after_shkia_date.omer.total_days, ), JewishCalendarSensorDescription( key="daf_yomi", translation_key="daf_yomi", entity_registry_enabled_default=False, - value_fn=lambda results: str(results.daytime_date.daf_yomi), + value_fn=lambda results: results.daytime_date.daf_yomi, ), ) diff --git a/requirements_all.txt b/requirements_all.txt index 2e0998a648f..8480beb7c66 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1133,7 +1133,7 @@ hass-splunk==0.1.1 hassil==2.2.3 # homeassistant.components.jewish_calendar -hdate[astral]==1.1.1 +hdate[astral]==1.1.2 # homeassistant.components.heatmiser heatmiserV3==2.0.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 07e4bd250d7..2704f0614b0 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -988,7 +988,7 @@ hass-nabucasa==0.101.0 hassil==2.2.3 # homeassistant.components.jewish_calendar -hdate[astral]==1.1.1 +hdate[astral]==1.1.2 # homeassistant.components.here_travel_time here-routing==1.0.1 From e048a3da38d3be49edd3b4c87efcf98ae8c3d131 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Thu, 12 Jun 2025 21:38:42 +0200 Subject: [PATCH 08/18] Bump linkplay to v0.2.12 (#146669) --- homeassistant/components/linkplay/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/linkplay/manifest.json b/homeassistant/components/linkplay/manifest.json index d6319c7a506..335f1acf396 100644 --- a/homeassistant/components/linkplay/manifest.json +++ b/homeassistant/components/linkplay/manifest.json @@ -7,6 +7,6 @@ "integration_type": "hub", "iot_class": "local_polling", "loggers": ["linkplay"], - "requirements": ["python-linkplay==0.2.11"], + "requirements": ["python-linkplay==0.2.12"], "zeroconf": ["_linkplay._tcp.local."] } diff --git a/requirements_all.txt b/requirements_all.txt index 8480beb7c66..b3d56a49e8c 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2452,7 +2452,7 @@ python-juicenet==1.1.0 python-kasa[speedups]==0.10.2 # homeassistant.components.linkplay -python-linkplay==0.2.11 +python-linkplay==0.2.12 # homeassistant.components.lirc # python-lirc==1.2.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 2704f0614b0..4732e5467ec 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2022,7 +2022,7 @@ python-juicenet==1.1.0 python-kasa[speedups]==0.10.2 # homeassistant.components.linkplay -python-linkplay==0.2.11 +python-linkplay==0.2.12 # homeassistant.components.lirc # python-lirc==1.2.3 From c2cf3482556ecc01758ab1f1b5c881c878ecf28c Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Fri, 13 Jun 2025 19:49:18 +0300 Subject: [PATCH 09/18] Filter speak notify entity for WHA devices in Alexa Devices (#146688) --- homeassistant/components/alexa_devices/notify.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/alexa_devices/notify.py b/homeassistant/components/alexa_devices/notify.py index ff0cd4e59ea..46db294377a 100644 --- a/homeassistant/components/alexa_devices/notify.py +++ b/homeassistant/components/alexa_devices/notify.py @@ -7,6 +7,7 @@ from dataclasses import dataclass from typing import Any, Final from aioamazondevices.api import AmazonDevice, AmazonEchoApi +from aioamazondevices.const import SPEAKER_GROUP_FAMILY from homeassistant.components.notify import NotifyEntity, NotifyEntityDescription from homeassistant.core import HomeAssistant @@ -22,6 +23,7 @@ PARALLEL_UPDATES = 1 class AmazonNotifyEntityDescription(NotifyEntityDescription): """Alexa Devices notify entity description.""" + is_supported: Callable[[AmazonDevice], bool] = lambda _device: True method: Callable[[AmazonEchoApi, AmazonDevice, str], Awaitable[None]] subkey: str @@ -31,6 +33,7 @@ NOTIFY: Final = ( key="speak", translation_key="speak", subkey="AUDIO_PLAYER", + is_supported=lambda _device: _device.device_family != SPEAKER_GROUP_FAMILY, method=lambda api, device, message: api.call_alexa_speak(device, message), ), AmazonNotifyEntityDescription( @@ -58,6 +61,7 @@ async def async_setup_entry( for sensor_desc in NOTIFY for serial_num in coordinator.data if sensor_desc.subkey in coordinator.data[serial_num].capabilities + and sensor_desc.is_supported(coordinator.data[serial_num]) ) From e81c8ce44d9f76656e85d512f2c4fa43a562d65c Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Fri, 13 Jun 2025 16:53:18 +0300 Subject: [PATCH 10/18] Bump aioamazondevices to 3.1.2 (#146690) --- homeassistant/components/alexa_devices/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/alexa_devices/conftest.py | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/alexa_devices/manifest.json b/homeassistant/components/alexa_devices/manifest.json index 2a9e88cfd85..96f17d541fc 100644 --- a/homeassistant/components/alexa_devices/manifest.json +++ b/homeassistant/components/alexa_devices/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_polling", "loggers": ["aioamazondevices"], "quality_scale": "bronze", - "requirements": ["aioamazondevices==3.0.6"] + "requirements": ["aioamazondevices==3.1.2"] } diff --git a/requirements_all.txt b/requirements_all.txt index b3d56a49e8c..bf71c75a83c 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -182,7 +182,7 @@ aioairzone-cloud==0.6.12 aioairzone==1.0.0 # homeassistant.components.alexa_devices -aioamazondevices==3.0.6 +aioamazondevices==3.1.2 # homeassistant.components.ambient_network # homeassistant.components.ambient_station diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 4732e5467ec..61e98df6960 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -170,7 +170,7 @@ aioairzone-cloud==0.6.12 aioairzone==1.0.0 # homeassistant.components.alexa_devices -aioamazondevices==3.0.6 +aioamazondevices==3.1.2 # homeassistant.components.ambient_network # homeassistant.components.ambient_station diff --git a/tests/components/alexa_devices/conftest.py b/tests/components/alexa_devices/conftest.py index 4ce2eb743ea..f1f40eebd27 100644 --- a/tests/components/alexa_devices/conftest.py +++ b/tests/components/alexa_devices/conftest.py @@ -56,6 +56,9 @@ def mock_amazon_devices_client() -> Generator[AsyncMock]: do_not_disturb=False, response_style=None, bluetooth_state=True, + entity_id="11111111-2222-3333-4444-555555555555", + appliance_id="G1234567890123456789012345678A", + sensors={}, ) } client.get_model_details = lambda device: DEVICE_TYPE_TO_MODEL.get( From 4ec711bd633a174f87aca2c59dfb9899e8ef94ba Mon Sep 17 00:00:00 2001 From: tronikos Date: Fri, 13 Jun 2025 06:58:27 -0700 Subject: [PATCH 11/18] Fix opower to work with aiohttp>=3.12.7 by disabling cookie quoting (#146697) Co-authored-by: J. Nick Koston --- homeassistant/components/opower/config_flow.py | 3 ++- homeassistant/components/opower/coordinator.py | 6 ++++-- homeassistant/components/opower/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/opower/config_flow.py b/homeassistant/components/opower/config_flow.py index 6396ba24a15..4753a77894e 100644 --- a/homeassistant/components/opower/config_flow.py +++ b/homeassistant/components/opower/config_flow.py @@ -10,6 +10,7 @@ from opower import ( CannotConnect, InvalidAuth, Opower, + create_cookie_jar, get_supported_utility_names, select_utility, ) @@ -39,7 +40,7 @@ async def _validate_login( ) -> dict[str, str]: """Validate login data and return any errors.""" api = Opower( - async_create_clientsession(hass), + async_create_clientsession(hass, cookie_jar=create_cookie_jar()), login_data[CONF_UTILITY], login_data[CONF_USERNAME], login_data[CONF_PASSWORD], diff --git a/homeassistant/components/opower/coordinator.py b/homeassistant/components/opower/coordinator.py index d03c30b7db0..189fa185cd1 100644 --- a/homeassistant/components/opower/coordinator.py +++ b/homeassistant/components/opower/coordinator.py @@ -12,6 +12,7 @@ from opower import ( MeterType, Opower, ReadResolution, + create_cookie_jar, ) from opower.exceptions import ApiException, CannotConnect, InvalidAuth @@ -30,7 +31,8 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, UnitOfEnergy, UnitOfVolume from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryAuthFailed -from homeassistant.helpers import aiohttp_client, issue_registry as ir +from homeassistant.helpers import issue_registry as ir +from homeassistant.helpers.aiohttp_client import async_create_clientsession from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from homeassistant.util import dt as dt_util @@ -62,7 +64,7 @@ class OpowerCoordinator(DataUpdateCoordinator[dict[str, Forecast]]): update_interval=timedelta(hours=12), ) self.api = Opower( - aiohttp_client.async_get_clientsession(hass), + async_create_clientsession(hass, cookie_jar=create_cookie_jar()), config_entry.data[CONF_UTILITY], config_entry.data[CONF_USERNAME], config_entry.data[CONF_PASSWORD], diff --git a/homeassistant/components/opower/manifest.json b/homeassistant/components/opower/manifest.json index 0aa26dbb4b1..4e88c5a68cc 100644 --- a/homeassistant/components/opower/manifest.json +++ b/homeassistant/components/opower/manifest.json @@ -7,5 +7,5 @@ "documentation": "https://www.home-assistant.io/integrations/opower", "iot_class": "cloud_polling", "loggers": ["opower"], - "requirements": ["opower==0.12.3"] + "requirements": ["opower==0.12.4"] } diff --git a/requirements_all.txt b/requirements_all.txt index bf71c75a83c..c54b30689ad 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1617,7 +1617,7 @@ openwrt-luci-rpc==1.1.17 openwrt-ubus-rpc==0.0.2 # homeassistant.components.opower -opower==0.12.3 +opower==0.12.4 # homeassistant.components.oralb oralb-ble==0.17.6 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 61e98df6960..3a18bc52b4c 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1370,7 +1370,7 @@ openhomedevice==2.2.0 openwebifpy==4.3.1 # homeassistant.components.opower -opower==0.12.3 +opower==0.12.4 # homeassistant.components.oralb oralb-ble==0.17.6 From cb74b2663f5f19f7741066a9e9a9355989ea8186 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Fri, 13 Jun 2025 03:46:01 -0700 Subject: [PATCH 12/18] Revert scan interval change in local calendar (#146700) --- homeassistant/components/local_calendar/calendar.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/homeassistant/components/local_calendar/calendar.py b/homeassistant/components/local_calendar/calendar.py index 8534cc1bfbf..639cf5234d1 100644 --- a/homeassistant/components/local_calendar/calendar.py +++ b/homeassistant/components/local_calendar/calendar.py @@ -36,11 +36,6 @@ _LOGGER = logging.getLogger(__name__) PRODID = "-//homeassistant.io//local_calendar 1.0//EN" -# The calendar on disk is only changed when this entity is updated, so there -# is no need to poll for changes. The calendar enttiy base class will handle -# refreshing the entity state based on the start or end time of the event. -SCAN_INTERVAL = timedelta(days=1) - async def async_setup_entry( hass: HomeAssistant, From d4ffeedc875afcf2b1270a80eb4ae7e4dd4b7701 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Fri, 13 Jun 2025 03:47:56 -0700 Subject: [PATCH 13/18] Partial revert of update to remote calendar to fix issue where calendar does not update (#146702) Partial revert --- .../components/remote_calendar/calendar.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/remote_calendar/calendar.py b/homeassistant/components/remote_calendar/calendar.py index 2f60918f010..f6918ea9706 100644 --- a/homeassistant/components/remote_calendar/calendar.py +++ b/homeassistant/components/remote_calendar/calendar.py @@ -4,6 +4,7 @@ from datetime import datetime import logging from ical.event import Event +from ical.timeline import Timeline from homeassistant.components.calendar import CalendarEntity, CalendarEvent from homeassistant.core import HomeAssistant @@ -48,12 +49,18 @@ class RemoteCalendarEntity( super().__init__(coordinator) self._attr_name = entry.data[CONF_CALENDAR_NAME] self._attr_unique_id = entry.entry_id - self._event: CalendarEvent | None = None + self._timeline: Timeline | None = None @property def event(self) -> CalendarEvent | None: """Return the next upcoming event.""" - return self._event + if self._timeline is None: + return None + now = dt_util.now() + events = self._timeline.active_after(now) + if event := next(events, None): + return _get_calendar_event(event) + return None async def async_get_events( self, hass: HomeAssistant, start_date: datetime, end_date: datetime @@ -79,15 +86,12 @@ class RemoteCalendarEntity( """ await super().async_update() - def next_timeline_event() -> CalendarEvent | None: + def _get_timeline() -> Timeline | None: """Return the next active event.""" now = dt_util.now() - events = self.coordinator.data.timeline_tz(now.tzinfo).active_after(now) - if event := next(events, None): - return _get_calendar_event(event) - return None + return self.coordinator.data.timeline_tz(now.tzinfo) - self._event = await self.hass.async_add_executor_job(next_timeline_event) + self._timeline = await self.hass.async_add_executor_job(_get_timeline) def _get_calendar_event(event: Event) -> CalendarEvent: From e89c3b1e929257b9c96c91f990a330292111a49b Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 13 Jun 2025 15:09:37 +0200 Subject: [PATCH 14/18] Ignore lingering pycares shutdown thread (#146733) --- tests/conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d13384055b1..3bacacc6c04 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -382,8 +382,10 @@ def verify_cleanup( # Verify no threads where left behind. threads = frozenset(threading.enumerate()) - threads_before for thread in threads: - assert isinstance(thread, threading._DummyThread) or thread.name.startswith( - "waitpid-" + assert ( + isinstance(thread, threading._DummyThread) + or thread.name.startswith("waitpid-") + or "_run_safe_shutdown_loop" in thread.name ) try: From a017d9415bd4d8ce02e1db5dfc791ff3a0dc336b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 13 Jun 2025 12:12:52 -0500 Subject: [PATCH 15/18] Bump aiodns to 3.5.0 (#146758) --- homeassistant/components/dnsip/manifest.json | 2 +- homeassistant/package_constraints.txt | 2 +- pyproject.toml | 2 +- requirements.txt | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/dnsip/manifest.json b/homeassistant/components/dnsip/manifest.json index e004b386e02..6008fb83e1b 100644 --- a/homeassistant/components/dnsip/manifest.json +++ b/homeassistant/components/dnsip/manifest.json @@ -5,5 +5,5 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/dnsip", "iot_class": "cloud_polling", - "requirements": ["aiodns==3.4.0"] + "requirements": ["aiodns==3.5.0"] } diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 64f9d1649a6..ac33b8fe9f1 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -2,7 +2,7 @@ aiodhcpwatcher==1.2.0 aiodiscover==2.7.0 -aiodns==3.4.0 +aiodns==3.5.0 aiofiles==24.1.0 aiohasupervisor==0.3.1 aiohttp-asyncmdnsresolver==0.1.1 diff --git a/pyproject.toml b/pyproject.toml index 07f19628d0f..cdfd79cc764 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ ] requires-python = ">=3.13.2" dependencies = [ - "aiodns==3.4.0", + "aiodns==3.5.0", "aiofiles==24.1.0", # Integrations may depend on hassio integration without listing it to # change behavior based on presence of supervisor. Deprecated with #127228 diff --git a/requirements.txt b/requirements.txt index 6dc604d877b..333198a5346 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ -c homeassistant/package_constraints.txt # Home Assistant Core -aiodns==3.4.0 +aiodns==3.5.0 aiofiles==24.1.0 aiohasupervisor==0.3.1 aiohttp==3.12.12 diff --git a/requirements_all.txt b/requirements_all.txt index c54b30689ad..d8cf0d2841c 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -223,7 +223,7 @@ aiodhcpwatcher==1.2.0 aiodiscover==2.7.0 # homeassistant.components.dnsip -aiodns==3.4.0 +aiodns==3.5.0 # homeassistant.components.duke_energy aiodukeenergy==0.3.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 3a18bc52b4c..7be1fcb1346 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -211,7 +211,7 @@ aiodhcpwatcher==1.2.0 aiodiscover==2.7.0 # homeassistant.components.dnsip -aiodns==3.4.0 +aiodns==3.5.0 # homeassistant.components.duke_energy aiodukeenergy==0.3.0 From df5f2531463754633d1348d9028bde0f335b48fe Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 13 Jun 2025 17:20:24 +0000 Subject: [PATCH 16/18] Bump version to 2025.6.1 --- homeassistant/const.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index c006cd9dbed..9d5ed69f8d7 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -25,7 +25,7 @@ if TYPE_CHECKING: APPLICATION_NAME: Final = "HomeAssistant" MAJOR_VERSION: Final = 2025 MINOR_VERSION: Final = 6 -PATCH_VERSION: Final = "0" +PATCH_VERSION: Final = "1" __short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__: Final = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 13, 2) diff --git a/pyproject.toml b/pyproject.toml index cdfd79cc764..067b310f371 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "homeassistant" -version = "2025.6.0" +version = "2025.6.1" license = "Apache-2.0" license-files = ["LICENSE*", "homeassistant/backports/LICENSE*"] description = "Open-source home automation platform running on Python 3." From 2175754a1fcf827c908a3f4dd886ace47334a30c Mon Sep 17 00:00:00 2001 From: hahn-th <15319212+hahn-th@users.noreply.github.com> Date: Fri, 13 Jun 2025 19:57:03 +0200 Subject: [PATCH 17/18] Fix throttling issue in HomematicIP Cloud (#146683) Co-authored-by: J. Nick Koston --- .../components/homematicip_cloud/hap.py | 55 ++++++------------- .../homematicip_cloud/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- .../components/homematicip_cloud/test_hap.py | 21 ++++++- 5 files changed, 41 insertions(+), 41 deletions(-) diff --git a/homeassistant/components/homematicip_cloud/hap.py b/homeassistant/components/homematicip_cloud/hap.py index f3681a89110..c42ebff200d 100644 --- a/homeassistant/components/homematicip_cloud/hap.py +++ b/homeassistant/components/homematicip_cloud/hap.py @@ -128,6 +128,7 @@ class HomematicipHAP: self.config_entry.data.get(HMIPC_AUTHTOKEN), self.config_entry.data.get(HMIPC_NAME), ) + except HmipcConnectionError as err: raise ConfigEntryNotReady from err except Exception as err: # noqa: BLE001 @@ -210,41 +211,13 @@ class HomematicipHAP: for device in self.home.devices: device.fire_update_event() - async def async_connect(self) -> None: - """Start WebSocket connection.""" - tries = 0 - while True: - retry_delay = 2 ** min(tries, 8) + async def async_connect(self, home: AsyncHome) -> None: + """Connect to HomematicIP Cloud Websocket.""" + await home.enable_events() - try: - await self.home.get_current_state_async() - hmip_events = self.home.enable_events() - self.home.set_on_connected_handler(self.ws_connected_handler) - self.home.set_on_disconnected_handler(self.ws_disconnected_handler) - tries = 0 - await hmip_events - except HmipConnectionError: - _LOGGER.error( - ( - "Error connecting to HomematicIP with HAP %s. " - "Retrying in %d seconds" - ), - self.config_entry.unique_id, - retry_delay, - ) - - if self._ws_close_requested: - break - self._ws_close_requested = False - tries += 1 - - try: - self._retry_task = self.hass.async_create_task( - asyncio.sleep(retry_delay) - ) - await self._retry_task - except asyncio.CancelledError: - break + home.set_on_connected_handler(self.ws_connected_handler) + home.set_on_disconnected_handler(self.ws_disconnected_handler) + home.set_on_reconnect_handler(self.ws_reconnected_handler) async def async_reset(self) -> bool: """Close the websocket connection.""" @@ -272,14 +245,22 @@ class HomematicipHAP: async def ws_connected_handler(self) -> None: """Handle websocket connected.""" - _LOGGER.debug("WebSocket connection to HomematicIP established") + _LOGGER.info("Websocket connection to HomematicIP Cloud established") if self._ws_connection_closed.is_set(): await self.get_state() self._ws_connection_closed.clear() async def ws_disconnected_handler(self) -> None: """Handle websocket disconnection.""" - _LOGGER.warning("WebSocket connection to HomematicIP closed") + _LOGGER.warning("Websocket connection to HomematicIP Cloud closed") + self._ws_connection_closed.set() + + async def ws_reconnected_handler(self, reason: str) -> None: + """Handle websocket reconnection.""" + _LOGGER.info( + "Websocket connection to HomematicIP Cloud re-established due to reason: %s", + reason, + ) self._ws_connection_closed.set() async def get_hap( @@ -306,6 +287,6 @@ class HomematicipHAP: home.on_update(self.async_update) home.on_create(self.async_create_entity) - hass.loop.create_task(self.async_connect()) + await self.async_connect(home) return home diff --git a/homeassistant/components/homematicip_cloud/manifest.json b/homeassistant/components/homematicip_cloud/manifest.json index fc4a1cb831f..163f3c402dc 100644 --- a/homeassistant/components/homematicip_cloud/manifest.json +++ b/homeassistant/components/homematicip_cloud/manifest.json @@ -6,5 +6,5 @@ "documentation": "https://www.home-assistant.io/integrations/homematicip_cloud", "iot_class": "cloud_push", "loggers": ["homematicip"], - "requirements": ["homematicip==2.0.4"] + "requirements": ["homematicip==2.0.5"] } diff --git a/requirements_all.txt b/requirements_all.txt index d8cf0d2841c..d0e8b10ce42 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1170,7 +1170,7 @@ home-assistant-frontend==20250531.3 home-assistant-intents==2025.6.10 # homeassistant.components.homematicip_cloud -homematicip==2.0.4 +homematicip==2.0.5 # homeassistant.components.horizon horimote==0.4.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 7be1fcb1346..861c8097470 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1016,7 +1016,7 @@ home-assistant-frontend==20250531.3 home-assistant-intents==2025.6.10 # homeassistant.components.homematicip_cloud -homematicip==2.0.4 +homematicip==2.0.5 # homeassistant.components.remember_the_milk httplib2==0.20.4 diff --git a/tests/components/homematicip_cloud/test_hap.py b/tests/components/homematicip_cloud/test_hap.py index c258c85ac93..dec74fedc08 100644 --- a/tests/components/homematicip_cloud/test_hap.py +++ b/tests/components/homematicip_cloud/test_hap.py @@ -1,6 +1,6 @@ """Test HomematicIP Cloud accesspoint.""" -from unittest.mock import Mock, patch +from unittest.mock import AsyncMock, Mock, patch from homematicip.auth import Auth from homematicip.connection.connection_context import ConnectionContext @@ -16,6 +16,7 @@ from homeassistant.components.homematicip_cloud.const import ( ) from homeassistant.components.homematicip_cloud.errors import HmipcConnectionError from homeassistant.components.homematicip_cloud.hap import ( + AsyncHome, HomematicipAuth, HomematicipHAP, ) @@ -251,3 +252,21 @@ async def test_get_state_after_disconnect( assert hap._ws_connection_closed.is_set() await hap.ws_connected_handler() mock_get_state.assert_called_once() + + +async def test_async_connect( + hass: HomeAssistant, hmip_config_entry: MockConfigEntry, simple_mock_home +) -> None: + """Test async_connect.""" + hass.config.components.add(DOMAIN) + hap = HomematicipHAP(hass, hmip_config_entry) + assert hap + + simple_mock_home = AsyncMock(spec=AsyncHome, autospec=True) + + await hap.async_connect(simple_mock_home) + + simple_mock_home.set_on_connected_handler.assert_called_once() + simple_mock_home.set_on_disconnected_handler.assert_called_once() + simple_mock_home.set_on_reconnect_handler.assert_called_once() + simple_mock_home.enable_events.assert_called_once() From 25d1480f2a4b67e09f6040d58874de58b555af5a Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 13 Jun 2025 18:09:05 +0000 Subject: [PATCH 18/18] Hotfix ruff warnings --- tests/components/homematicip_cloud/test_hap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/components/homematicip_cloud/test_hap.py b/tests/components/homematicip_cloud/test_hap.py index dec74fedc08..6d1e6024b68 100644 --- a/tests/components/homematicip_cloud/test_hap.py +++ b/tests/components/homematicip_cloud/test_hap.py @@ -258,7 +258,7 @@ async def test_async_connect( hass: HomeAssistant, hmip_config_entry: MockConfigEntry, simple_mock_home ) -> None: """Test async_connect.""" - hass.config.components.add(DOMAIN) + hass.config.components.add(HMIPC_DOMAIN) hap = HomematicipHAP(hass, hmip_config_entry) assert hap