Prepare ring update service for deprecation (#108781)

* Prepare ring update service for deprecation

* Update service removal release number
This commit is contained in:
Steven B 2024-03-11 12:42:52 +00:00 committed by GitHub
parent f8d1232598
commit 48cb09a4a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 59 additions and 0 deletions

View file

@ -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()