Deprecate api_call action in Habitica integration (#128119)
This commit is contained in:
parent
fbc4a87166
commit
980b0fa5e6
2 changed files with 18 additions and 0 deletions
|
@ -19,6 +19,7 @@ from homeassistant.core import (
|
||||||
)
|
)
|
||||||
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
|
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
|
||||||
from homeassistant.helpers.selector import ConfigEntrySelector
|
from homeassistant.helpers.selector import ConfigEntrySelector
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
|
@ -96,6 +97,19 @@ def async_setup_services(hass: HomeAssistant) -> None: # noqa: C901
|
||||||
"""Set up services for Habitica integration."""
|
"""Set up services for Habitica integration."""
|
||||||
|
|
||||||
async def handle_api_call(call: ServiceCall) -> None:
|
async def handle_api_call(call: ServiceCall) -> None:
|
||||||
|
async_create_issue(
|
||||||
|
hass,
|
||||||
|
DOMAIN,
|
||||||
|
"deprecated_api_call",
|
||||||
|
breaks_in_ha_version="2025.6.0",
|
||||||
|
is_fixable=False,
|
||||||
|
severity=IssueSeverity.WARNING,
|
||||||
|
translation_key="deprecated_api_call",
|
||||||
|
)
|
||||||
|
_LOGGER.warning(
|
||||||
|
"Deprecated action called: 'habitica.api_call' is deprecated and will be removed in Home Assistant version 2025.6.0"
|
||||||
|
)
|
||||||
|
|
||||||
name = call.data[ATTR_NAME]
|
name = call.data[ATTR_NAME]
|
||||||
path = call.data[ATTR_PATH]
|
path = call.data[ATTR_PATH]
|
||||||
entries = hass.config_entries.async_entries(DOMAIN)
|
entries = hass.config_entries.async_entries(DOMAIN)
|
||||||
|
|
|
@ -327,6 +327,10 @@
|
||||||
"deprecated_task_entity": {
|
"deprecated_task_entity": {
|
||||||
"title": "The Habitica {task_name} sensor is deprecated",
|
"title": "The Habitica {task_name} sensor is deprecated",
|
||||||
"description": "The Habitica entity `{entity}` is deprecated and will be removed in a future release.\nPlease update your automations and scripts to replace the sensor entity with the newly added todo entity.\nWhen you are done migrating you can disable `{entity}`."
|
"description": "The Habitica entity `{entity}` is deprecated and will be removed in a future release.\nPlease update your automations and scripts to replace the sensor entity with the newly added todo entity.\nWhen you are done migrating you can disable `{entity}`."
|
||||||
|
},
|
||||||
|
"deprecated_api_call": {
|
||||||
|
"title": "The Habitica action habitica.api_call is deprecated",
|
||||||
|
"description": "The Habitica action `habitica.api_call` is deprecated and will be removed in Home Assistant 2025.5.0.\n\nPlease update your automations and scripts to use other Habitica actions and entities."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"services": {
|
"services": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue