mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Deprecate hassio service to update addon (#127927)
* Deprecate hassio service to update addon * Update homeassistant/components/hassio/strings.json Co-authored-by: Stefan Agner <stefan@agner.ch> * service -> action * service -> action; in the title as well --------- Co-authored-by: Stefan Agner <stefan@agner.ch> Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
dd5e5323f1
commit
9d9b5af97f
@ -38,6 +38,7 @@ from homeassistant.helpers import (
|
|||||||
)
|
)
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
from homeassistant.helpers.event import async_call_later
|
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.storage import Store
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
from homeassistant.loader import bind_hass
|
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:
|
async def async_service_handler(service: ServiceCall) -> None:
|
||||||
"""Handle service calls for Hass.io."""
|
"""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]
|
api_endpoint = MAP_SERVICE_API[service.service]
|
||||||
|
|
||||||
data = service.data.copy()
|
data = service.data.copy()
|
||||||
|
@ -208,6 +208,10 @@
|
|||||||
"unsupported_virtualization_image": {
|
"unsupported_virtualization_image": {
|
||||||
"title": "Unsupported system - Incorrect OS image for virtualization",
|
"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."
|
"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": {
|
"entity": {
|
||||||
|
@ -24,7 +24,7 @@ from homeassistant.components.hassio.const import REQUEST_REFRESH_DELAY
|
|||||||
from homeassistant.components.hassio.handler import HassioAPIError
|
from homeassistant.components.hassio.handler import HassioAPIError
|
||||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||||
from homeassistant.core import HomeAssistant
|
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.setup import async_setup_component
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
@ -510,6 +510,7 @@ async def test_service_calls(
|
|||||||
aioclient_mock: AiohttpClientMocker,
|
aioclient_mock: AiohttpClientMocker,
|
||||||
caplog: pytest.LogCaptureFixture,
|
caplog: pytest.LogCaptureFixture,
|
||||||
addon_installed,
|
addon_installed,
|
||||||
|
issue_registry: ir.IssueRegistry,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Call service and check the API calls behind that."""
|
"""Call service and check the API calls behind that."""
|
||||||
with (
|
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_stop", {"addon": "test"})
|
||||||
await hass.services.async_call("hassio", "addon_restart", {"addon": "test"})
|
await hass.services.async_call("hassio", "addon_restart", {"addon": "test"})
|
||||||
await hass.services.async_call("hassio", "addon_update", {"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(
|
await hass.services.async_call(
|
||||||
"hassio", "addon_stdin", {"addon": "test", "input": "test"}
|
"hassio", "addon_stdin", {"addon": "test", "input": "test"}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user