Remove deprecated action call addon_update from Supervisor (#143404)

remove deprecated action call addon_update
This commit is contained in:
Michael 2025-04-22 10:39:17 +02:00 committed by GitHub
parent 8fb1c6535d
commit fbe2370df7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 50 deletions

View File

@ -51,7 +51,6 @@ from homeassistant.helpers.hassio import (
get_supervisor_ip as _get_supervisor_ip,
is_hassio as _is_hassio,
)
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
from homeassistant.helpers.service_info.hassio import (
HassioServiceInfo as _HassioServiceInfo,
)
@ -160,7 +159,6 @@ CONFIG_SCHEMA = vol.Schema(
SERVICE_ADDON_START = "addon_start"
SERVICE_ADDON_STOP = "addon_stop"
SERVICE_ADDON_RESTART = "addon_restart"
SERVICE_ADDON_UPDATE = "addon_update"
SERVICE_ADDON_STDIN = "addon_stdin"
SERVICE_HOST_SHUTDOWN = "host_shutdown"
SERVICE_HOST_REBOOT = "host_reboot"
@ -241,7 +239,6 @@ MAP_SERVICE_API = {
SERVICE_ADDON_START: APIEndpointSettings("/addons/{addon}/start", SCHEMA_ADDON),
SERVICE_ADDON_STOP: APIEndpointSettings("/addons/{addon}/stop", SCHEMA_ADDON),
SERVICE_ADDON_RESTART: APIEndpointSettings("/addons/{addon}/restart", SCHEMA_ADDON),
SERVICE_ADDON_UPDATE: APIEndpointSettings("/addons/{addon}/update", SCHEMA_ADDON),
SERVICE_ADDON_STDIN: APIEndpointSettings(
"/addons/{addon}/stdin", SCHEMA_ADDON_STDIN
),
@ -411,16 +408,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: # noqa:
async def async_service_handler(service: ServiceCall) -> None:
"""Handle service calls for Hass.io."""
if service.service == SERVICE_ADDON_UPDATE:
async_create_issue(
hass,
DOMAIN,
"update_service_deprecated",
breaks_in_ha_version="2025.5",
is_fixable=False,
severity=IssueSeverity.WARNING,
translation_key="update_service_deprecated",
)
api_endpoint = MAP_SERVICE_API[service.service]
data = service.data.copy()

View File

@ -22,9 +22,6 @@
"addon_stop": {
"service": "mdi:stop"
},
"addon_update": {
"service": "mdi:update"
},
"host_reboot": {
"service": "mdi:restart"
},

View File

@ -30,14 +30,6 @@ addon_stop:
selector:
addon:
addon_update:
fields:
addon:
required: true
example: core_ssh
selector:
addon:
host_reboot:
host_shutdown:
backup_full:

View File

@ -225,10 +225,6 @@
"unsupported_virtualization_image": {
"title": "Unsupported system - Incorrect OS image for virtualization",
"description": "System is unsupported because the Home Assistant OS image in use is not intended for use in a virtualized environment. Use the link to learn more and how to fix this."
},
"update_service_deprecated": {
"title": "Deprecated update add-on action",
"description": "The update add-on action has been deprecated and will be removed in 2025.5. Please use the update entity and the respective action to update the add-on instead."
}
},
"entity": {
@ -313,16 +309,6 @@
}
}
},
"addon_update": {
"name": "Update add-on",
"description": "Updates an add-on. This action should be used with caution since add-on updates can contain breaking changes. It is highly recommended that you review release notes/change logs before updating an add-on.",
"fields": {
"addon": {
"name": "[%key:component::hassio::services::addon_start::fields::addon::name%]",
"description": "The add-on to update."
}
}
},
"host_reboot": {
"name": "Reboot the host system",
"description": "Reboots the host system."

View File

@ -26,7 +26,7 @@ from homeassistant.components.hassio.config import STORAGE_KEY
from homeassistant.components.hassio.const import REQUEST_REFRESH_DELAY
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, issue_registry as ir
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.hassio import is_hassio
from homeassistant.helpers.service_info.hassio import HassioServiceInfo
from homeassistant.setup import async_setup_component
@ -473,7 +473,6 @@ async def test_service_register(hass: HomeAssistant) -> None:
assert hass.services.has_service("hassio", "addon_start")
assert hass.services.has_service("hassio", "addon_stop")
assert hass.services.has_service("hassio", "addon_restart")
assert hass.services.has_service("hassio", "addon_update")
assert hass.services.has_service("hassio", "addon_stdin")
assert hass.services.has_service("hassio", "host_shutdown")
assert hass.services.has_service("hassio", "host_reboot")
@ -492,7 +491,6 @@ async def test_service_calls(
supervisor_client: AsyncMock,
addon_installed: AsyncMock,
supervisor_is_connected: AsyncMock,
issue_registry: ir.IssueRegistry,
) -> None:
"""Call service and check the API calls behind that."""
supervisor_is_connected.side_effect = SupervisorError
@ -519,21 +517,19 @@ async def test_service_calls(
await hass.services.async_call("hassio", "addon_start", {"addon": "test"})
await hass.services.async_call("hassio", "addon_stop", {"addon": "test"})
await hass.services.async_call("hassio", "addon_restart", {"addon": "test"})
await hass.services.async_call("hassio", "addon_update", {"addon": "test"})
assert (DOMAIN, "update_service_deprecated") in issue_registry.issues
await hass.services.async_call(
"hassio", "addon_stdin", {"addon": "test", "input": "test"}
)
await hass.async_block_till_done()
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 25
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 24
assert aioclient_mock.mock_calls[-1][2] == "test"
await hass.services.async_call("hassio", "host_shutdown", {})
await hass.services.async_call("hassio", "host_reboot", {})
await hass.async_block_till_done()
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 27
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 26
await hass.services.async_call("hassio", "backup_full", {})
await hass.services.async_call(
@ -548,7 +544,7 @@ async def test_service_calls(
)
await hass.async_block_till_done()
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 29
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 28
assert aioclient_mock.mock_calls[-1][2] == {
"name": "2021-11-13 03:48:00",
"homeassistant": True,
@ -573,7 +569,7 @@ async def test_service_calls(
)
await hass.async_block_till_done()
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 31
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 30
assert aioclient_mock.mock_calls[-1][2] == {
"addons": ["test"],
"folders": ["ssl"],
@ -592,7 +588,7 @@ async def test_service_calls(
)
await hass.async_block_till_done()
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 32
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 31
assert aioclient_mock.mock_calls[-1][2] == {
"name": "backup_name",
"location": "backup_share",
@ -608,7 +604,7 @@ async def test_service_calls(
)
await hass.async_block_till_done()
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 33
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 32
assert aioclient_mock.mock_calls[-1][2] == {
"name": "2021-11-13 03:48:00",
"location": None,
@ -627,7 +623,7 @@ async def test_service_calls(
)
await hass.async_block_till_done()
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 35
assert aioclient_mock.call_count + len(supervisor_client.mock_calls) == 34
assert aioclient_mock.mock_calls[-1][2] == {
"name": "2021-11-13 11:48:00",
"location": None,