Prepare ring update service for deprecation (#108781)
* Prepare ring update service for deprecation * Update service removal release number
This commit is contained in:
parent
f8d1232598
commit
48cb09a4a8
3 changed files with 59 additions and 0 deletions
|
@ -11,6 +11,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.const import APPLICATION_NAME, CONF_TOKEN, __version__
|
||||
from homeassistant.core import HomeAssistant, ServiceCall
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
|
||||
|
||||
from .const import (
|
||||
DOMAIN,
|
||||
|
@ -62,6 +63,23 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
|
||||
async def async_refresh_all(_: ServiceCall) -> None:
|
||||
"""Refresh all ring data."""
|
||||
_LOGGER.warning(
|
||||
"Detected use of service 'ring.update'. "
|
||||
"This is deprecated and will stop working in Home Assistant 2024.10. "
|
||||
"Use 'homeassistant.update_entity' instead which updates all ring entities",
|
||||
)
|
||||
async_create_issue(
|
||||
hass,
|
||||
DOMAIN,
|
||||
"deprecated_service_ring_update",
|
||||
breaks_in_ha_version="2024.10.0",
|
||||
is_fixable=True,
|
||||
is_persistent=False,
|
||||
issue_domain=DOMAIN,
|
||||
severity=IssueSeverity.WARNING,
|
||||
translation_key="deprecated_service_ring_update",
|
||||
)
|
||||
|
||||
for info in hass.data[DOMAIN].values():
|
||||
await info[RING_DEVICES_COORDINATOR].async_refresh()
|
||||
await info[RING_NOTIFICATIONS_COORDINATOR].async_refresh()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue