From 7cbc3ea65f9d4269cfd87be95e2ea4860583f08e Mon Sep 17 00:00:00 2001 From: Arjan <44190435+vingerha@users.noreply.github.com> Date: Thu, 17 Apr 2025 08:47:37 +0200 Subject: [PATCH 01/12] Meteofrance: adding new states provided by MF API since mid April (#143137) --- homeassistant/components/meteo_france/const.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/meteo_france/const.py b/homeassistant/components/meteo_france/const.py index 2230f43b754..e64a55651d3 100644 --- a/homeassistant/components/meteo_france/const.py +++ b/homeassistant/components/meteo_france/const.py @@ -74,6 +74,7 @@ CONDITION_CLASSES: dict[str, list[str]] = { "Pluie modérée", "Pluie / Averses", "Averses", + "Averses faibles", "Pluie", ], ATTR_CONDITION_SNOWY: [ @@ -81,10 +82,11 @@ CONDITION_CLASSES: dict[str, list[str]] = { "Neige", "Averses de neige", "Neige forte", + "Neige faible", "Quelques flocons", ], ATTR_CONDITION_SNOWY_RAINY: ["Pluie et neige", "Pluie verglaçante"], - ATTR_CONDITION_SUNNY: ["Ensoleillé"], + ATTR_CONDITION_SUNNY: ["Ensoleillé", "Ciel clair"], ATTR_CONDITION_WINDY: [], ATTR_CONDITION_WINDY_VARIANT: [], ATTR_CONDITION_EXCEPTIONAL: [], From d8233b4de535c0a28a4559ab6c21a13b05df6742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Diego=20Rodr=C3=ADguez=20Royo?= Date: Fri, 18 Apr 2025 00:09:52 +0200 Subject: [PATCH 02/12] Create Home Connect active and selected program entities only when there are programs (#143185) * Create active and selected program entities only when there are programs * Test improvements --- .../components/home_connect/coordinator.py | 4 +- .../components/home_connect/select.py | 3 +- .../home_connect/fixtures/programs.json | 24 +++++++++ .../snapshots/test_diagnostics.ambr | 3 ++ .../home_connect/test_binary_sensor.py | 35 +++++++++--- tests/components/home_connect/test_button.py | 46 +++++++++++----- tests/components/home_connect/test_light.py | 41 +++++++------- tests/components/home_connect/test_number.py | 31 ++++++++--- tests/components/home_connect/test_select.py | 53 +++++++++++++++++-- tests/components/home_connect/test_sensor.py | 29 +++++++--- tests/components/home_connect/test_switch.py | 45 +++++++++++----- tests/components/home_connect/test_time.py | 29 +++++++--- 12 files changed, 265 insertions(+), 78 deletions(-) diff --git a/homeassistant/components/home_connect/coordinator.py b/homeassistant/components/home_connect/coordinator.py index 05a6a592ae8..0a0e0c78463 100644 --- a/homeassistant/components/home_connect/coordinator.py +++ b/homeassistant/components/home_connect/coordinator.py @@ -241,9 +241,7 @@ class HomeConnectCoordinator( appliance_data = await self._get_appliance_data( appliance_info, self.data.get(appliance_info.ha_id) ) - if event_message_ha_id in self.data: - self.data[event_message_ha_id].update(appliance_data) - else: + if event_message_ha_id not in self.data: self.data[event_message_ha_id] = appliance_data for listener, context in self._special_listeners.values(): if ( diff --git a/homeassistant/components/home_connect/select.py b/homeassistant/components/home_connect/select.py index c82e0686cb5..7d8b315b657 100644 --- a/homeassistant/components/home_connect/select.py +++ b/homeassistant/components/home_connect/select.py @@ -17,7 +17,6 @@ from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from .common import setup_home_connect_entry from .const import ( - APPLIANCES_WITH_PROGRAMS, AVAILABLE_MAPS_ENUM, BEAN_AMOUNT_OPTIONS, BEAN_CONTAINER_OPTIONS, @@ -313,7 +312,7 @@ def _get_entities_for_appliance( HomeConnectProgramSelectEntity(entry.runtime_data, appliance, desc) for desc in PROGRAM_SELECT_ENTITY_DESCRIPTIONS ] - if appliance.info.type in APPLIANCES_WITH_PROGRAMS + if appliance.programs else [] ), *[ diff --git a/tests/components/home_connect/fixtures/programs.json b/tests/components/home_connect/fixtures/programs.json index bba1a5d2721..e8d8bd24705 100644 --- a/tests/components/home_connect/fixtures/programs.json +++ b/tests/components/home_connect/fixtures/programs.json @@ -181,5 +181,29 @@ } ] } + }, + "Hood": { + "data": { + "programs": [ + { + "key": "Cooking.Common.Program.Hood.Automatic", + "constraints": { + "execution": "selectandstart" + } + }, + { + "key": "Cooking.Common.Program.Hood.Venting", + "constraints": { + "execution": "selectandstart" + } + }, + { + "key": "Cooking.Common.Program.Hood.DelayedShutOff", + "constraints": { + "execution": "selectandstart" + } + } + ] + } } } diff --git a/tests/components/home_connect/snapshots/test_diagnostics.ambr b/tests/components/home_connect/snapshots/test_diagnostics.ambr index 28f45ce97ba..535119b941c 100644 --- a/tests/components/home_connect/snapshots/test_diagnostics.ambr +++ b/tests/components/home_connect/snapshots/test_diagnostics.ambr @@ -90,6 +90,9 @@ 'ha_id': 'BOSCH-HCS000000-D00000000004', 'name': 'Hood', 'programs': list([ + 'Cooking.Common.Program.Hood.Automatic', + 'Cooking.Common.Program.Hood.Venting', + 'Cooking.Common.Program.Hood.DelayedShutOff', ]), 'settings': dict({ 'BSH.Common.Setting.AmbientLightBrightness': 70, diff --git a/tests/components/home_connect/test_binary_sensor.py b/tests/components/home_connect/test_binary_sensor.py index ce879a38de5..672d04e108b 100644 --- a/tests/components/home_connect/test_binary_sensor.py +++ b/tests/components/home_connect/test_binary_sensor.py @@ -11,6 +11,7 @@ from aiohomeconnect.model import ( EventMessage, EventType, HomeAppliance, + StatusKey, ) from aiohomeconnect.model.error import HomeConnectApiError import pytest @@ -115,9 +116,19 @@ async def test_paired_depaired_devices_flow( assert entity_registry.async_get(entity_entry.entity_id) -@pytest.mark.parametrize("appliance", ["Washer"], indirect=True) +@pytest.mark.parametrize( + ("appliance", "keys_to_check"), + [ + ( + "Washer", + (StatusKey.BSH_COMMON_REMOTE_CONTROL_ACTIVE,), + ) + ], + indirect=["appliance"], +) async def test_connected_devices( appliance: HomeAppliance, + keys_to_check: tuple, hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[MagicMock], Awaitable[bool]], @@ -148,7 +159,17 @@ async def test_connected_devices( device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) assert device - entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) + assert entity_registry.async_get_entity_id( + Platform.BINARY_SENSOR, + DOMAIN, + f"{appliance.ha_id}-{EventKey.BSH_COMMON_APPLIANCE_CONNECTED}", + ) + for key in keys_to_check: + assert not entity_registry.async_get_entity_id( + Platform.BINARY_SENSOR, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) await client.add_events( [ @@ -161,10 +182,12 @@ async def test_connected_devices( ) await hass.async_block_till_done() - device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) - assert device - new_entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) - assert len(new_entity_entries) > len(entity_entries) + for key in (*keys_to_check, EventKey.BSH_COMMON_APPLIANCE_CONNECTED): + assert entity_registry.async_get_entity_id( + Platform.BINARY_SENSOR, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) @pytest.mark.usefixtures("entity_registry_enabled_by_default") diff --git a/tests/components/home_connect/test_button.py b/tests/components/home_connect/test_button.py index f894494792d..c96fe840238 100644 --- a/tests/components/home_connect/test_button.py +++ b/tests/components/home_connect/test_button.py @@ -99,9 +99,19 @@ async def test_paired_depaired_devices_flow( assert entity_registry.async_get(entity_entry.entity_id) -@pytest.mark.parametrize("appliance", ["Washer"], indirect=True) +@pytest.mark.parametrize( + ("appliance", "keys_to_check"), + [ + ( + "Washer", + (CommandKey.BSH_COMMON_PAUSE_PROGRAM,), + ) + ], + indirect=["appliance"], +) async def test_connected_devices( appliance: HomeAppliance, + keys_to_check: tuple, hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[MagicMock], Awaitable[bool]], @@ -116,7 +126,7 @@ async def test_connected_devices( not be obtained while disconnected and once connected, the entities are added. """ get_available_commands_original_mock = client.get_available_commands - get_available_programs_mock = client.get_available_programs + get_all_programs_mock = client.get_all_programs async def get_available_commands_side_effect(ha_id: str): if ha_id == appliance.ha_id: @@ -125,28 +135,36 @@ async def test_connected_devices( ) return await get_available_commands_original_mock.side_effect(ha_id) - async def get_available_programs_side_effect(ha_id: str): + async def get_all_programs_side_effect(ha_id: str): if ha_id == appliance.ha_id: raise HomeConnectApiError( "SDK.Error.HomeAppliance.Connection.Initialization.Failed" ) - return await get_available_programs_mock.side_effect(ha_id) + return await get_all_programs_mock.side_effect(ha_id) client.get_available_commands = AsyncMock( side_effect=get_available_commands_side_effect ) - client.get_available_programs = AsyncMock( - side_effect=get_available_programs_side_effect - ) + client.get_all_programs = AsyncMock(side_effect=get_all_programs_side_effect) assert config_entry.state == ConfigEntryState.NOT_LOADED assert await integration_setup(client) assert config_entry.state == ConfigEntryState.LOADED client.get_available_commands = get_available_commands_original_mock - client.get_available_programs = get_available_programs_mock + client.get_all_programs = get_all_programs_mock device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) assert device - entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) + assert entity_registry.async_get_entity_id( + Platform.BUTTON, + DOMAIN, + f"{appliance.ha_id}-StopProgram", + ) + for key in keys_to_check: + assert not entity_registry.async_get_entity_id( + Platform.BUTTON, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) await client.add_events( [ @@ -159,10 +177,12 @@ async def test_connected_devices( ) await hass.async_block_till_done() - device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) - assert device - new_entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) - assert len(new_entity_entries) > len(entity_entries) + for key in (*keys_to_check, "StopProgram"): + assert entity_registry.async_get_entity_id( + Platform.BUTTON, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) @pytest.mark.parametrize("appliance", ["Washer"], indirect=True) diff --git a/tests/components/home_connect/test_light.py b/tests/components/home_connect/test_light.py index 50a1a1e374a..298eead1737 100644 --- a/tests/components/home_connect/test_light.py +++ b/tests/components/home_connect/test_light.py @@ -119,9 +119,19 @@ async def test_paired_depaired_devices_flow( assert entity_registry.async_get(entity_entry.entity_id) -@pytest.mark.parametrize("appliance", ["Hood"], indirect=True) +@pytest.mark.parametrize( + ("appliance", "keys_to_check"), + [ + ( + "Hood", + (SettingKey.COOKING_COMMON_LIGHTING,), + ) + ], + indirect=["appliance"], +) async def test_connected_devices( appliance: HomeAppliance, + keys_to_check: tuple, hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[MagicMock], Awaitable[bool]], @@ -136,7 +146,6 @@ async def test_connected_devices( not be obtained while disconnected and once connected, the entities are added. """ get_settings_original_mock = client.get_settings - get_available_programs_mock = client.get_available_programs async def get_settings_side_effect(ha_id: str): if ha_id == appliance.ha_id: @@ -145,26 +154,20 @@ async def test_connected_devices( ) return await get_settings_original_mock.side_effect(ha_id) - async def get_available_programs_side_effect(ha_id: str): - if ha_id == appliance.ha_id: - raise HomeConnectApiError( - "SDK.Error.HomeAppliance.Connection.Initialization.Failed" - ) - return await get_available_programs_mock.side_effect(ha_id) - client.get_settings = AsyncMock(side_effect=get_settings_side_effect) - client.get_available_programs = AsyncMock( - side_effect=get_available_programs_side_effect - ) assert config_entry.state == ConfigEntryState.NOT_LOADED assert await integration_setup(client) assert config_entry.state == ConfigEntryState.LOADED client.get_settings = get_settings_original_mock - client.get_available_programs = get_available_programs_mock device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) assert device - entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) + for key in keys_to_check: + assert not entity_registry.async_get_entity_id( + Platform.LIGHT, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) await client.add_events( [ @@ -177,10 +180,12 @@ async def test_connected_devices( ) await hass.async_block_till_done() - device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) - assert device - new_entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) - assert len(new_entity_entries) > len(entity_entries) + for key in keys_to_check: + assert entity_registry.async_get_entity_id( + Platform.LIGHT, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) @pytest.mark.parametrize("appliance", ["Hood"], indirect=True) diff --git a/tests/components/home_connect/test_number.py b/tests/components/home_connect/test_number.py index 1de384303ce..7e89f66683b 100644 --- a/tests/components/home_connect/test_number.py +++ b/tests/components/home_connect/test_number.py @@ -135,9 +135,21 @@ async def test_paired_depaired_devices_flow( assert entity_registry.async_get(entity_entry.entity_id) -@pytest.mark.parametrize("appliance", ["FridgeFreezer"], indirect=True) +@pytest.mark.parametrize( + ("appliance", "keys_to_check"), + [ + ( + "FridgeFreezer", + ( + SettingKey.REFRIGERATION_FRIDGE_FREEZER_SETPOINT_TEMPERATURE_REFRIGERATOR, + ), + ) + ], + indirect=["appliance"], +) async def test_connected_devices( appliance: HomeAppliance, + keys_to_check: tuple, hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[MagicMock], Awaitable[bool]], @@ -168,7 +180,12 @@ async def test_connected_devices( device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) assert device - entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) + for key in keys_to_check: + assert not entity_registry.async_get_entity_id( + Platform.NUMBER, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) await client.add_events( [ @@ -181,10 +198,12 @@ async def test_connected_devices( ) await hass.async_block_till_done() - device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) - assert device - new_entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) - assert len(new_entity_entries) > len(entity_entries) + for key in keys_to_check: + assert entity_registry.async_get_entity_id( + Platform.NUMBER, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) @pytest.mark.parametrize("appliance", ["FridgeFreezer"], indirect=True) diff --git a/tests/components/home_connect/test_select.py b/tests/components/home_connect/test_select.py index f6009640f72..4f3f804eb06 100644 --- a/tests/components/home_connect/test_select.py +++ b/tests/components/home_connect/test_select.py @@ -20,6 +20,7 @@ from aiohomeconnect.model import ( ) from aiohomeconnect.model.error import ( ActiveProgramNotSetError, + HomeConnectApiError, HomeConnectError, SelectedProgramNotSetError, TooManyRequestsError, @@ -138,9 +139,23 @@ async def test_paired_depaired_devices_flow( assert entity_registry.async_get(entity_entry.entity_id) -@pytest.mark.parametrize("appliance", ["Washer"], indirect=True) +@pytest.mark.parametrize( + ("appliance", "keys_to_check"), + [ + ( + "Hood", + ( + EventKey.BSH_COMMON_ROOT_ACTIVE_PROGRAM, + EventKey.BSH_COMMON_ROOT_SELECTED_PROGRAM, + SettingKey.COOKING_HOOD_COLOR_TEMPERATURE, + ), + ) + ], + indirect=["appliance"], +) async def test_connected_devices( appliance: HomeAppliance, + keys_to_check: tuple, hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[MagicMock], Awaitable[bool]], @@ -154,13 +169,39 @@ async def test_connected_devices( Specifically those devices whose settings, status, etc. could not be obtained while disconnected and once connected, the entities are added. """ + get_settings_original_mock = client.get_settings + get_all_programs_mock = client.get_all_programs + async def get_settings_side_effect(ha_id: str): + if ha_id == appliance.ha_id: + raise HomeConnectApiError( + "SDK.Error.HomeAppliance.Connection.Initialization.Failed" + ) + return await get_settings_original_mock.side_effect(ha_id) + + async def get_all_programs_side_effect(ha_id: str): + if ha_id == appliance.ha_id: + raise HomeConnectApiError( + "SDK.Error.HomeAppliance.Connection.Initialization.Failed" + ) + return await get_all_programs_mock.side_effect(ha_id) + + client.get_settings = AsyncMock(side_effect=get_settings_side_effect) + client.get_all_programs = AsyncMock(side_effect=get_all_programs_side_effect) assert config_entry.state == ConfigEntryState.NOT_LOADED assert await integration_setup(client) assert config_entry.state == ConfigEntryState.LOADED + client.get_settings = get_settings_original_mock + client.get_all_programs = get_all_programs_mock device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) assert device + for key in keys_to_check: + assert not entity_registry.async_get_entity_id( + Platform.SELECT, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) await client.add_events( [ @@ -173,10 +214,12 @@ async def test_connected_devices( ) await hass.async_block_till_done() - device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) - assert device - entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) - assert entity_entries + for key in keys_to_check: + assert entity_registry.async_get_entity_id( + Platform.SELECT, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) @pytest.mark.parametrize("appliance", ["Washer"], indirect=True) diff --git a/tests/components/home_connect/test_sensor.py b/tests/components/home_connect/test_sensor.py index f30723af7fa..f0481318a37 100644 --- a/tests/components/home_connect/test_sensor.py +++ b/tests/components/home_connect/test_sensor.py @@ -154,9 +154,19 @@ async def test_paired_depaired_devices_flow( assert entity_registry.async_get(entity_entry.entity_id) -@pytest.mark.parametrize("appliance", ["Washer"], indirect=True) +@pytest.mark.parametrize( + ("appliance", "keys_to_check"), + [ + ( + "Washer", + (StatusKey.BSH_COMMON_OPERATION_STATE,), + ) + ], + indirect=["appliance"], +) async def test_connected_devices( appliance: HomeAppliance, + keys_to_check: tuple, hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[MagicMock], Awaitable[bool]], @@ -187,7 +197,12 @@ async def test_connected_devices( device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) assert device - entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) + for key in keys_to_check: + assert not entity_registry.async_get_entity_id( + Platform.SENSOR, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) await client.add_events( [ @@ -200,10 +215,12 @@ async def test_connected_devices( ) await hass.async_block_till_done() - device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) - assert device - new_entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) - assert len(new_entity_entries) > len(entity_entries) + for key in keys_to_check: + assert entity_registry.async_get_entity_id( + Platform.SENSOR, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) @pytest.mark.parametrize("appliance", [TEST_HC_APP], indirect=True) diff --git a/tests/components/home_connect/test_switch.py b/tests/components/home_connect/test_switch.py index 01f9cad5d2e..2f8b95ceab2 100644 --- a/tests/components/home_connect/test_switch.py +++ b/tests/components/home_connect/test_switch.py @@ -147,9 +147,23 @@ async def test_paired_depaired_devices_flow( assert entity_registry.async_get(entity_entry.entity_id) -@pytest.mark.parametrize("appliance", ["Washer"], indirect=True) +@pytest.mark.parametrize( + ("appliance", "keys_to_check"), + [ + ( + "Washer", + ( + SettingKey.BSH_COMMON_POWER_STATE, + SettingKey.BSH_COMMON_CHILD_LOCK, + "Program Cotton", + ), + ) + ], + indirect=["appliance"], +) async def test_connected_devices( appliance: HomeAppliance, + keys_to_check: tuple, hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[MagicMock], Awaitable[bool]], @@ -164,7 +178,7 @@ async def test_connected_devices( not be obtained while disconnected and once connected, the entities are added. """ get_settings_original_mock = client.get_settings - get_available_programs_mock = client.get_available_programs + get_all_programs_mock = client.get_all_programs async def get_settings_side_effect(ha_id: str): if ha_id == appliance.ha_id: @@ -173,26 +187,29 @@ async def test_connected_devices( ) return await get_settings_original_mock.side_effect(ha_id) - async def get_available_programs_side_effect(ha_id: str): + async def get_all_programs_side_effect(ha_id: str): if ha_id == appliance.ha_id: raise HomeConnectApiError( "SDK.Error.HomeAppliance.Connection.Initialization.Failed" ) - return await get_available_programs_mock.side_effect(ha_id) + return await get_all_programs_mock.side_effect(ha_id) client.get_settings = AsyncMock(side_effect=get_settings_side_effect) - client.get_available_programs = AsyncMock( - side_effect=get_available_programs_side_effect - ) + client.get_all_programs = AsyncMock(side_effect=get_all_programs_side_effect) assert config_entry.state == ConfigEntryState.NOT_LOADED assert await integration_setup(client) assert config_entry.state == ConfigEntryState.LOADED client.get_settings = get_settings_original_mock - client.get_available_programs = get_available_programs_mock + client.get_all_programs = get_all_programs_mock device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) assert device - entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) + for key in keys_to_check: + assert not entity_registry.async_get_entity_id( + Platform.SWITCH, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) await client.add_events( [ @@ -205,10 +222,12 @@ async def test_connected_devices( ) await hass.async_block_till_done() - device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) - assert device - new_entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) - assert len(new_entity_entries) > len(entity_entries) + for key in keys_to_check: + assert entity_registry.async_get_entity_id( + Platform.SWITCH, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) @pytest.mark.usefixtures("entity_registry_enabled_by_default") diff --git a/tests/components/home_connect/test_time.py b/tests/components/home_connect/test_time.py index 8c23a09053a..34781c29eb8 100644 --- a/tests/components/home_connect/test_time.py +++ b/tests/components/home_connect/test_time.py @@ -113,9 +113,19 @@ async def test_paired_depaired_devices_flow( @pytest.mark.usefixtures("entity_registry_enabled_by_default") -@pytest.mark.parametrize("appliance", ["Oven"], indirect=True) +@pytest.mark.parametrize( + ("appliance", "keys_to_check"), + [ + ( + "Oven", + (SettingKey.BSH_COMMON_ALARM_CLOCK,), + ) + ], + indirect=["appliance"], +) async def test_connected_devices( appliance: HomeAppliance, + keys_to_check: tuple, hass: HomeAssistant, config_entry: MockConfigEntry, integration_setup: Callable[[MagicMock], Awaitable[bool]], @@ -146,7 +156,12 @@ async def test_connected_devices( device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) assert device - entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) + for key in keys_to_check: + assert not entity_registry.async_get_entity_id( + Platform.TIME, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) await client.add_events( [ @@ -159,10 +174,12 @@ async def test_connected_devices( ) await hass.async_block_till_done() - device = device_registry.async_get_device(identifiers={(DOMAIN, appliance.ha_id)}) - assert device - new_entity_entries = entity_registry.entities.get_entries_for_device_id(device.id) - assert len(new_entity_entries) > len(entity_entries) + for key in keys_to_check: + assert entity_registry.async_get_entity_id( + Platform.TIME, + DOMAIN, + f"{appliance.ha_id}-{key}", + ) @pytest.mark.usefixtures("entity_registry_enabled_by_default") From 2e05dc86182e4b995e385326f783c988f46bfa59 Mon Sep 17 00:00:00 2001 From: Arjan <44190435+vingerha@users.noreply.github.com> Date: Wed, 23 Apr 2025 14:44:36 +0200 Subject: [PATCH 03/12] =?UTF-8?q?M=C3=A9t=C3=A9o-France:=20Additional=20st?= =?UTF-8?q?ates=20and=20change=20weather=20condition=20for=20"Ciel=20clair?= =?UTF-8?q?"=20(#143198)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Additional new states and change for ciel-clair * Adding new previously unmapped state * Adding new forecast state Adding Brouillard dense, reported after the review --- homeassistant/components/meteo_france/const.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/meteo_france/const.py b/homeassistant/components/meteo_france/const.py index e64a55651d3..382a56d50d7 100644 --- a/homeassistant/components/meteo_france/const.py +++ b/homeassistant/components/meteo_france/const.py @@ -40,7 +40,7 @@ ATTR_NEXT_RAIN_DT_REF = "forecast_time_ref" CONDITION_CLASSES: dict[str, list[str]] = { - ATTR_CONDITION_CLEAR_NIGHT: ["Nuit Claire", "Nuit claire"], + ATTR_CONDITION_CLEAR_NIGHT: ["Nuit Claire", "Nuit claire", "Ciel clair"], ATTR_CONDITION_CLOUDY: ["Très nuageux", "Couvert"], ATTR_CONDITION_FOG: [ "Brume ou bancs de brouillard", @@ -48,9 +48,10 @@ CONDITION_CLASSES: dict[str, list[str]] = { "Brouillard", "Brouillard givrant", "Bancs de Brouillard", + "Brouillard dense", ], ATTR_CONDITION_HAIL: ["Risque de grêle", "Risque de grèle"], - ATTR_CONDITION_LIGHTNING: ["Risque d'orages", "Orages"], + ATTR_CONDITION_LIGHTNING: ["Risque d'orages", "Orages", "Orage avec grêle"], ATTR_CONDITION_LIGHTNING_RAINY: [ "Pluie orageuses", "Pluies orageuses", @@ -62,6 +63,7 @@ CONDITION_CLASSES: dict[str, list[str]] = { "Éclaircies", "Eclaircies", "Peu nuageux", + "Variable", ], ATTR_CONDITION_POURING: ["Pluie forte"], ATTR_CONDITION_RAINY: [ @@ -83,10 +85,11 @@ CONDITION_CLASSES: dict[str, list[str]] = { "Averses de neige", "Neige forte", "Neige faible", + "Averses de neige faible", "Quelques flocons", ], ATTR_CONDITION_SNOWY_RAINY: ["Pluie et neige", "Pluie verglaçante"], - ATTR_CONDITION_SUNNY: ["Ensoleillé", "Ciel clair"], + ATTR_CONDITION_SUNNY: ["Ensoleillé"], ATTR_CONDITION_WINDY: [], ATTR_CONDITION_WINDY_VARIANT: [], ATTR_CONDITION_EXCEPTIONAL: [], From 10ac39f6b2cbe6f988caae728817e2f011310a53 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sun, 20 Apr 2025 03:57:53 +0200 Subject: [PATCH 04/12] Update setuptools to 78.1.1 (#143275) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d365ec9c8c5..b7866e2f234 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==77.0.3"] +requires = ["setuptools==78.1.1"] build-backend = "setuptools.build_meta" [project] From 73707fa23176c9d5bf4768597f49e376ec9c9ca0 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sun, 20 Apr 2025 02:24:44 +0200 Subject: [PATCH 05/12] Fix licenses check for setuptools (#143292) --- script/licenses.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/licenses.py b/script/licenses.py index ab8ab62eb1d..aed3bec9998 100644 --- a/script/licenses.py +++ b/script/licenses.py @@ -191,7 +191,6 @@ EXCEPTIONS = { "enocean", # https://github.com/kipe/enocean/pull/142 "imutils", # https://github.com/PyImageSearch/imutils/pull/292 "iso4217", # Public domain - "jaraco.itertools", # MIT - https://github.com/jaraco/jaraco.itertools/issues/21 "kiwiki_client", # https://github.com/c7h/kiwiki_client/pull/6 "ld2410-ble", # https://github.com/930913/ld2410-ble/pull/7 "maxcube-api", # https://github.com/uebelack/python-maxcube-api/pull/48 @@ -205,6 +204,11 @@ EXCEPTIONS = { "repoze.lru", "sharp_aquos_rc", # https://github.com/jmoore987/sharp_aquos_rc/pull/14 "tapsaff", # https://github.com/bazwilliams/python-taps-aff/pull/5 + # --- + # https://github.com/jaraco/skeleton/pull/170 + # https://github.com/jaraco/skeleton/pull/171 + "jaraco.itertools", # MIT - https://github.com/jaraco/jaraco.itertools/issues/21 + "setuptools", # MIT } TODO = { From deb966128f71d0b98bf8dc838144da4b51bb6278 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Tue, 22 Apr 2025 13:11:39 +0200 Subject: [PATCH 06/12] Add scan interval and parallel updates to LinkPlay media player (#143324) --- homeassistant/components/linkplay/media_player.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/linkplay/media_player.py b/homeassistant/components/linkplay/media_player.py index 16b0d5f75f1..67aa424e3a2 100644 --- a/homeassistant/components/linkplay/media_player.py +++ b/homeassistant/components/linkplay/media_player.py @@ -2,6 +2,7 @@ from __future__ import annotations +from datetime import timedelta import logging from typing import Any @@ -120,6 +121,8 @@ SERVICE_PLAY_PRESET_SCHEMA = cv.make_entity_service_schema( ) RETRY_POLL_MAXIMUM = 3 +SCAN_INTERVAL = timedelta(seconds=5) +PARALLEL_UPDATES = 1 async def async_setup_entry( From afa6ed09ef65a631efece53ed9b3c519bca55674 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Mon, 21 Apr 2025 13:58:47 +0200 Subject: [PATCH 07/12] Sync random sensor device classes (#143368) --- homeassistant/components/random/strings.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/random/strings.json b/homeassistant/components/random/strings.json index e5c5543e39f..bacd6dd5a17 100644 --- a/homeassistant/components/random/strings.json +++ b/homeassistant/components/random/strings.json @@ -84,8 +84,10 @@ "options": { "apparent_power": "[%key:component::sensor::entity_component::apparent_power::name%]", "aqi": "[%key:component::sensor::entity_component::aqi::name%]", + "area": "[%key:component::sensor::entity_component::area::name%]", "atmospheric_pressure": "[%key:component::sensor::entity_component::atmospheric_pressure::name%]", "battery": "[%key:component::sensor::entity_component::battery::name%]", + "blood_glucose_concentration": "[%key:component::sensor::entity_component::blood_glucose_concentration::name%]", "carbon_dioxide": "[%key:component::sensor::entity_component::carbon_dioxide::name%]", "carbon_monoxide": "[%key:component::sensor::entity_component::carbon_monoxide::name%]", "conductivity": "[%key:component::sensor::entity_component::conductivity::name%]", From c38a3a239ccd0c0cb438df2aedfc88501b4bfb25 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Sun, 20 Apr 2025 23:56:09 +0200 Subject: [PATCH 08/12] Fix Vodafone Station config entry unload (#143371) --- .../components/vodafone_station/__init__.py | 2 -- tests/components/vodafone_station/conftest.py | 2 +- .../components/vodafone_station/test_init.py | 20 +++++++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/vodafone_station/__init__.py b/homeassistant/components/vodafone_station/__init__.py index 9f118fe4fbd..b4ba5663ac2 100644 --- a/homeassistant/components/vodafone_station/__init__.py +++ b/homeassistant/components/vodafone_station/__init__.py @@ -3,7 +3,6 @@ from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, Platform from homeassistant.core import HomeAssistant -from .const import DOMAIN from .coordinator import VodafoneConfigEntry, VodafoneStationRouter PLATFORMS = [Platform.BUTTON, Platform.DEVICE_TRACKER, Platform.SENSOR] @@ -36,7 +35,6 @@ async def async_unload_entry(hass: HomeAssistant, entry: VodafoneConfigEntry) -> coordinator = entry.runtime_data await coordinator.api.logout() await coordinator.api.close() - hass.data[DOMAIN].pop(entry.entry_id) return unload_ok diff --git a/tests/components/vodafone_station/conftest.py b/tests/components/vodafone_station/conftest.py index a065a1e8065..778d8fdaa41 100644 --- a/tests/components/vodafone_station/conftest.py +++ b/tests/components/vodafone_station/conftest.py @@ -5,7 +5,7 @@ from datetime import UTC, datetime from aiovodafone import VodafoneStationDevice import pytest -from homeassistant.components.vodafone_station import DOMAIN +from homeassistant.components.vodafone_station.const import DOMAIN from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME from .const import DEVICE_1_HOST, DEVICE_1_MAC, DEVICE_2_MAC diff --git a/tests/components/vodafone_station/test_init.py b/tests/components/vodafone_station/test_init.py index 12b3c3dce8f..053f0a95fe4 100644 --- a/tests/components/vodafone_station/test_init.py +++ b/tests/components/vodafone_station/test_init.py @@ -3,6 +3,8 @@ from unittest.mock import AsyncMock from homeassistant.components.device_tracker import CONF_CONSIDER_HOME +from homeassistant.components.vodafone_station.const import DOMAIN +from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType @@ -31,3 +33,21 @@ async def test_reload_config_entry_with_options( assert result["data"] == { CONF_CONSIDER_HOME: 37, } + + +async def test_unload_entry( + hass: HomeAssistant, + mock_vodafone_station_router: AsyncMock, + mock_config_entry: MockConfigEntry, +) -> None: + """Test unloading the config entry.""" + await setup_integration(hass, mock_config_entry) + + assert len(hass.config_entries.async_entries(DOMAIN)) == 1 + assert mock_config_entry.state is ConfigEntryState.LOADED + + assert await hass.config_entries.async_unload(mock_config_entry.entry_id) + await hass.async_block_till_done() + + assert mock_config_entry.state is ConfigEntryState.NOT_LOADED + assert not hass.data.get(DOMAIN) From b3deeca939576d026ff2959ef007181ea0d45122 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 21 Apr 2025 23:00:40 -1000 Subject: [PATCH 09/12] Bump aiohomekit to 3.2.14 (#143440) --- homeassistant/components/homekit_controller/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/homekit_controller/manifest.json b/homeassistant/components/homekit_controller/manifest.json index 6562a3edcc9..dbcd2788c8a 100644 --- a/homeassistant/components/homekit_controller/manifest.json +++ b/homeassistant/components/homekit_controller/manifest.json @@ -14,6 +14,6 @@ "documentation": "https://www.home-assistant.io/integrations/homekit_controller", "iot_class": "local_push", "loggers": ["aiohomekit", "commentjson"], - "requirements": ["aiohomekit==3.2.13"], + "requirements": ["aiohomekit==3.2.14"], "zeroconf": ["_hap._tcp.local.", "_hap._udp.local."] } diff --git a/requirements_all.txt b/requirements_all.txt index 81284e09591..fbffea57bae 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -267,7 +267,7 @@ aiohasupervisor==0.3.0 aiohomeconnect==0.16.3 # homeassistant.components.homekit_controller -aiohomekit==3.2.13 +aiohomekit==3.2.14 # homeassistant.components.mcp_server aiohttp_sse==2.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index c2fc32e6503..a0297b02563 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -252,7 +252,7 @@ aiohasupervisor==0.3.0 aiohomeconnect==0.16.3 # homeassistant.components.homekit_controller -aiohomekit==3.2.13 +aiohomekit==3.2.14 # homeassistant.components.mcp_server aiohttp_sse==2.2.0 From 7392d5a30a547577f06ec2e4ee230edc8745b71e Mon Sep 17 00:00:00 2001 From: cnico Date: Wed, 23 Apr 2025 09:31:43 +0200 Subject: [PATCH 10/12] Bump dio-chacon-api to v1.2.2 (#143489) Bump dio-chacon-api to v1.2.2 to solve https://github.com/home-assistant/core/issues/142808 --- homeassistant/components/chacon_dio/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/chacon_dio/manifest.json b/homeassistant/components/chacon_dio/manifest.json index edee24444f7..117982a7ab8 100644 --- a/homeassistant/components/chacon_dio/manifest.json +++ b/homeassistant/components/chacon_dio/manifest.json @@ -6,5 +6,5 @@ "documentation": "https://www.home-assistant.io/integrations/chacon_dio", "iot_class": "cloud_push", "loggers": ["dio_chacon_api"], - "requirements": ["dio-chacon-wifi-api==1.2.1"] + "requirements": ["dio-chacon-wifi-api==1.2.2"] } diff --git a/requirements_all.txt b/requirements_all.txt index fbffea57bae..7e9d81a4149 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -784,7 +784,7 @@ devolo-home-control-api==0.18.3 devolo-plc-api==1.5.1 # homeassistant.components.chacon_dio -dio-chacon-wifi-api==1.2.1 +dio-chacon-wifi-api==1.2.2 # homeassistant.components.directv directv==0.4.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a0297b02563..6e2a740373f 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -675,7 +675,7 @@ devolo-home-control-api==0.18.3 devolo-plc-api==1.5.1 # homeassistant.components.chacon_dio -dio-chacon-wifi-api==1.2.1 +dio-chacon-wifi-api==1.2.2 # homeassistant.components.directv directv==0.4.0 From 6a2d733d853653ca33d5f9d4198aefc364ebaeec Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Thu, 24 Apr 2025 18:13:58 +0200 Subject: [PATCH 11/12] Bump pysmartthings to 3.0.5 (#143586) --- homeassistant/components/smartthings/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/smartthings/manifest.json b/homeassistant/components/smartthings/manifest.json index 4cd27e49664..c682b5402c4 100644 --- a/homeassistant/components/smartthings/manifest.json +++ b/homeassistant/components/smartthings/manifest.json @@ -30,5 +30,5 @@ "iot_class": "cloud_push", "loggers": ["pysmartthings"], "quality_scale": "bronze", - "requirements": ["pysmartthings==3.0.4"] + "requirements": ["pysmartthings==3.0.5"] } diff --git a/requirements_all.txt b/requirements_all.txt index 7e9d81a4149..9c8bf7ae9aa 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2319,7 +2319,7 @@ pysma==0.7.5 pysmappee==0.2.29 # homeassistant.components.smartthings -pysmartthings==3.0.4 +pysmartthings==3.0.5 # homeassistant.components.smarty pysmarty2==0.10.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 6e2a740373f..2abcb85e499 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1889,7 +1889,7 @@ pysma==0.7.5 pysmappee==0.2.29 # homeassistant.components.smartthings -pysmartthings==3.0.4 +pysmartthings==3.0.5 # homeassistant.components.smarty pysmarty2==0.10.2 From 2214d9b330cc8c148040f40978ab7913c0f4bee4 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Fri, 25 Apr 2025 06:54:02 +0000 Subject: [PATCH 12/12] Bump version to 2025.4.4 --- 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 6c29fbb42cd..25c5eaf019b 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 = 4 -PATCH_VERSION: Final = "3" +PATCH_VERSION: Final = "4" __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, 0) diff --git a/pyproject.toml b/pyproject.toml index b7866e2f234..c1a6ffbadff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "homeassistant" -version = "2025.4.3" +version = "2025.4.4" license = "Apache-2.0" license-files = ["LICENSE*", "homeassistant/backports/LICENSE*"] description = "Open-source home automation platform running on Python 3."