mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Deprecate Home Connect command actions (#139093)
* Deprecate command actions * Improve issue description * Improve issue description Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
c1e5673cbd
commit
1cd82ab8ee
@ -405,6 +405,17 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa:
|
||||
"""Execute calls to services executing a command."""
|
||||
client, ha_id = await _get_client_and_ha_id(hass, call.data[ATTR_DEVICE_ID])
|
||||
|
||||
async_create_issue(
|
||||
hass,
|
||||
DOMAIN,
|
||||
"deprecated_command_actions",
|
||||
breaks_in_ha_version="2025.9.0",
|
||||
is_fixable=True,
|
||||
is_persistent=True,
|
||||
severity=IssueSeverity.WARNING,
|
||||
translation_key="deprecated_command_actions",
|
||||
)
|
||||
|
||||
try:
|
||||
await client.put_command(ha_id, command_key=command_key, value=True)
|
||||
except HomeConnectError as err:
|
||||
@ -610,6 +621,7 @@ async def async_unload_entry(
|
||||
) -> bool:
|
||||
"""Unload a config entry."""
|
||||
async_delete_issue(hass, DOMAIN, "deprecated_set_program_and_option_actions")
|
||||
async_delete_issue(hass, DOMAIN, "deprecated_command_actions")
|
||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||
|
||||
|
||||
|
@ -108,6 +108,10 @@
|
||||
"title": "Deprecated binary door sensor detected in some automations or scripts",
|
||||
"description": "The binary door sensor `{entity}`, which is deprecated, is used in the following automations or scripts:\n{items}\n\nA sensor entity with additional possible states is available and should be used going forward; Please use it on the above automations or scripts to fix this issue."
|
||||
},
|
||||
"deprecated_command_actions": {
|
||||
"title": "The command related actions are deprecated in favor of the new buttons",
|
||||
"description": "The `pause_program` and `resume_program` actions have been deprecated in favor of new button entities, if the command is available for your appliance. Please update your automations, scripts and panels that use this action to use the button entities instead, and press on submit to fix the issue."
|
||||
},
|
||||
"deprecated_program_switch": {
|
||||
"title": "Deprecated program switch detected in some automations or scripts",
|
||||
"description": "Program switches are deprecated and {entity_id} is used in the following automations or scripts:\n{items}\n\nYou can use the active program select entity to run the program without any additional options and get the current running program on the above automations or scripts to fix this issue."
|
||||
|
@ -338,11 +338,27 @@ async def test_key_value_services(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"service_call",
|
||||
DEPRECATED_SERVICE_KV_CALL_PARAMS + SERVICE_PROGRAM_CALL_PARAMS,
|
||||
("service_call", "issue_id"),
|
||||
[
|
||||
*zip(
|
||||
DEPRECATED_SERVICE_KV_CALL_PARAMS + SERVICE_PROGRAM_CALL_PARAMS,
|
||||
["deprecated_set_program_and_option_actions"]
|
||||
* (
|
||||
len(DEPRECATED_SERVICE_KV_CALL_PARAMS)
|
||||
+ len(SERVICE_PROGRAM_CALL_PARAMS)
|
||||
),
|
||||
strict=True,
|
||||
),
|
||||
*zip(
|
||||
SERVICE_COMMAND_CALL_PARAMS,
|
||||
["deprecated_command_actions"] * len(SERVICE_COMMAND_CALL_PARAMS),
|
||||
strict=True,
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_programs_and_options_actions_deprecation(
|
||||
service_call: dict[str, Any],
|
||||
issue_id: str,
|
||||
hass: HomeAssistant,
|
||||
device_registry: dr.DeviceRegistry,
|
||||
config_entry: MockConfigEntry,
|
||||
@ -354,7 +370,6 @@ async def test_programs_and_options_actions_deprecation(
|
||||
hass_client: ClientSessionGenerator,
|
||||
) -> None:
|
||||
"""Test deprecated service keys."""
|
||||
issue_id = "deprecated_set_program_and_option_actions"
|
||||
assert config_entry.state == ConfigEntryState.NOT_LOADED
|
||||
assert await integration_setup(client)
|
||||
assert config_entry.state == ConfigEntryState.LOADED
|
||||
|
Loading…
x
Reference in New Issue
Block a user