diff --git a/homeassistant/components/hassio/__init__.py b/homeassistant/components/hassio/__init__.py index 7aa4285314d..2f962b2e5db 100644 --- a/homeassistant/components/hassio/__init__.py +++ b/homeassistant/components/hassio/__init__.py @@ -38,6 +38,7 @@ from homeassistant.helpers import ( ) from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.event import async_call_later +from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue from homeassistant.helpers.storage import Store from homeassistant.helpers.typing import ConfigType from homeassistant.loader import bind_hass @@ -395,6 +396,16 @@ 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() diff --git a/homeassistant/components/hassio/strings.json b/homeassistant/components/hassio/strings.json index c304373b27b..8688934ee3d 100644 --- a/homeassistant/components/hassio/strings.json +++ b/homeassistant/components/hassio/strings.json @@ -208,6 +208,10 @@ "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": { diff --git a/tests/components/hassio/test_init.py b/tests/components/hassio/test_init.py index 13626ef19d0..22193a0c038 100644 --- a/tests/components/hassio/test_init.py +++ b/tests/components/hassio/test_init.py @@ -24,7 +24,7 @@ from homeassistant.components.hassio.const import REQUEST_REFRESH_DELAY from homeassistant.components.hassio.handler import HassioAPIError from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.core import HomeAssistant -from homeassistant.helpers import device_registry as dr +from homeassistant.helpers import device_registry as dr, issue_registry as ir from homeassistant.setup import async_setup_component from homeassistant.util import dt as dt_util @@ -510,6 +510,7 @@ async def test_service_calls( aioclient_mock: AiohttpClientMocker, caplog: pytest.LogCaptureFixture, addon_installed, + issue_registry: ir.IssueRegistry, ) -> None: """Call service and check the API calls behind that.""" with ( @@ -542,6 +543,7 @@ async def test_service_calls( 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"} )