mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Deprecate DHW switch for SmartThings (#145011)
This commit is contained in:
parent
3e92f23680
commit
7410b8778a
@ -585,6 +585,14 @@
|
||||
"title": "[%key:component::smartthings::issues::deprecated_switch_appliance::title%]",
|
||||
"description": "The switch `{entity_id}` is deprecated and a media player entity has been added to replace it.\n\nThe switch was used in the following automations or scripts:\n{items}\n\nPlease use the new media player entity in the above automations or scripts and disable the entity to fix this issue."
|
||||
},
|
||||
"deprecated_switch_dhw": {
|
||||
"title": "Heat pump switch deprecated",
|
||||
"description": "The switch `{entity_id}` is deprecated and a water heater entity has been added to replace it.\n\nPlease use the new water heater entity in the above automations or scripts and disable the entity to fix this issue."
|
||||
},
|
||||
"deprecated_switch_dhw_scripts": {
|
||||
"title": "[%key:component::smartthings::issues::deprecated_switch_dhw::title%]",
|
||||
"description": "The switch `{entity_id}` is deprecated and a water heater entity has been added to replace it.\n\nThe switch was used in the following automations or scripts:\n{items}\n\nPlease use the new water heater entity in the above automations or scripts and disable the entity to fix this issue."
|
||||
},
|
||||
"deprecated_media_player": {
|
||||
"title": "Media player sensors deprecated",
|
||||
"description": "The sensor {entity_name} (`{entity_id}`) is deprecated because it has been replaced with a media player entity.\n\nPlease update your dashboards, templates to use the new media player entity and disable the entity to fix this issue."
|
||||
|
@ -152,14 +152,24 @@ async def async_setup_entry(
|
||||
device.device.components[MAIN].manufacturer_category
|
||||
in INVALID_SWITCH_CATEGORIES
|
||||
)
|
||||
if media_player or appliance:
|
||||
issue = "media_player" if media_player else "appliance"
|
||||
dhw = Capability.SAMSUNG_CE_EHS_FSV_SETTINGS in device.status[MAIN]
|
||||
if media_player or appliance or dhw:
|
||||
if appliance:
|
||||
issue = "appliance"
|
||||
version = "2025.10.0"
|
||||
elif media_player:
|
||||
issue = "media_player"
|
||||
version = "2025.10.0"
|
||||
else:
|
||||
issue = "dhw"
|
||||
version = "2025.12.0"
|
||||
if deprecate_entity(
|
||||
hass,
|
||||
entity_registry,
|
||||
SWITCH_DOMAIN,
|
||||
f"{device.device.device_id}_{MAIN}_{Capability.SWITCH}_{Attribute.SWITCH}_{Attribute.SWITCH}",
|
||||
f"deprecated_switch_{issue}",
|
||||
version,
|
||||
):
|
||||
entities.append(
|
||||
SmartThingsSwitch(
|
||||
|
@ -19,6 +19,7 @@ def deprecate_entity(
|
||||
platform_domain: str,
|
||||
entity_unique_id: str,
|
||||
issue_string: str,
|
||||
version: str = "2025.10.0",
|
||||
) -> bool:
|
||||
"""Create an issue for deprecated entities."""
|
||||
if entity_id := entity_registry.async_get_entity_id(
|
||||
@ -51,7 +52,7 @@ def deprecate_entity(
|
||||
hass,
|
||||
DOMAIN,
|
||||
f"{issue_string}_{entity_id}",
|
||||
breaks_in_ha_version="2025.10.0",
|
||||
breaks_in_ha_version=version,
|
||||
is_fixable=False,
|
||||
severity=IssueSeverity.WARNING,
|
||||
translation_key=translation_key,
|
||||
|
@ -46,53 +46,6 @@
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_ac_ehs_01001][switch.heat_pump-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': None,
|
||||
'entity_id': 'switch.heat_pump',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '4165c51e-bf6b-c5b6-fd53-127d6248754b_main_switch_switch_switch',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_ac_ehs_01001][switch.heat_pump-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Heat pump',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.heat_pump',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_ref_normal_000001][switch.refrigerator_ice_maker-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
@ -281,100 +234,6 @@
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_sac_ehs_000001_sub][switch.eco_heating_system-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': None,
|
||||
'entity_id': 'switch.eco_heating_system',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '1f98ebd0-ac48-d802-7f62-000001200100_main_switch_switch_switch',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_sac_ehs_000001_sub][switch.eco_heating_system-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Eco Heating System',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.eco_heating_system',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_sac_ehs_000002_sub][switch.warmepumpe-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': None,
|
||||
'entity_id': 'switch.warmepumpe',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': None,
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '3810e5ad-5351-d9f9-12ff-000001200000_main_switch_switch_switch',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_sac_ehs_000002_sub][switch.warmepumpe-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Wärmepumpe',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.warmepumpe',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_wd_000001][switch.dryer_wrinkle_prevent-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@ -280,61 +280,77 @@ async def test_create_issue_with_items(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("device_fixture", "device_id", "suggested_object_id", "issue_string"),
|
||||
("device_fixture", "device_id", "suggested_object_id", "issue_string", "version"),
|
||||
[
|
||||
(
|
||||
"da_ks_cooktop_31001",
|
||||
"808dbd84-f357-47e2-a0cd-3b66fa22d584",
|
||||
"induction_hob",
|
||||
"appliance",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"da_ks_microwave_0101x",
|
||||
"2bad3237-4886-e699-1b90-4a51a3d55c8a",
|
||||
"microwave",
|
||||
"appliance",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"da_wm_dw_000001",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676",
|
||||
"dishwasher",
|
||||
"appliance",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"da_wm_sc_000001",
|
||||
"b93211bf-9d96-bd21-3b2f-964fcc87f5cc",
|
||||
"airdresser",
|
||||
"appliance",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"da_wm_wd_000001",
|
||||
"02f7256e-8353-5bdd-547f-bd5b1647e01b",
|
||||
"dryer",
|
||||
"appliance",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"da_wm_wm_000001",
|
||||
"f984b91d-f250-9d42-3436-33f09a422a47",
|
||||
"washer",
|
||||
"appliance",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"hw_q80r_soundbar",
|
||||
"afcf3b91-0000-1111-2222-ddff2a0a6577",
|
||||
"soundbar",
|
||||
"media_player",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"vd_network_audio_002s",
|
||||
"0d94e5db-8501-2355-eb4f-214163702cac",
|
||||
"soundbar_living",
|
||||
"media_player",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"vd_stv_2017_k",
|
||||
"4588d2d9-a8cf-40f4-9a0b-ed5dfbaccda1",
|
||||
"tv_samsung_8_series_49",
|
||||
"media_player",
|
||||
"2025.10.0",
|
||||
),
|
||||
(
|
||||
"da_sac_ehs_000002_sub",
|
||||
"3810e5ad-5351-d9f9-12ff-000001200000",
|
||||
"warmepumpe",
|
||||
"dhw",
|
||||
"2025.12.0",
|
||||
),
|
||||
],
|
||||
)
|
||||
@ -347,6 +363,7 @@ async def test_create_issue(
|
||||
device_id: str,
|
||||
suggested_object_id: str,
|
||||
issue_string: str,
|
||||
version: str,
|
||||
) -> None:
|
||||
"""Test we create an issue when an automation or script is using a deprecated entity."""
|
||||
entity_id = f"switch.{suggested_object_id}"
|
||||
@ -372,6 +389,7 @@ async def test_create_issue(
|
||||
"entity_id": entity_id,
|
||||
"entity_name": suggested_object_id,
|
||||
}
|
||||
assert issue.breaks_in_ha_version == version
|
||||
|
||||
entity_registry.async_update_entity(
|
||||
entity_entry.entity_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user