Remove deprecated blink refresh service (#119919)
* Remove deprecated blink refresh service * Remove string * Fix tests
This commit is contained in:
parent
f61347719f
commit
fe8805de6d
7 changed files with 9 additions and 170 deletions
|
@ -8,13 +8,9 @@ from homeassistant.config_entries import ConfigEntry, ConfigEntryState
|
|||
from homeassistant.const import ATTR_DEVICE_ID, CONF_PIN
|
||||
from homeassistant.core import HomeAssistant, ServiceCall
|
||||
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
|
||||
from homeassistant.helpers import (
|
||||
config_validation as cv,
|
||||
device_registry as dr,
|
||||
issue_registry as ir,
|
||||
)
|
||||
from homeassistant.helpers import config_validation as cv, device_registry as dr
|
||||
|
||||
from .const import ATTR_CONFIG_ENTRY_ID, DOMAIN, SERVICE_REFRESH, SERVICE_SEND_PIN
|
||||
from .const import ATTR_CONFIG_ENTRY_ID, DOMAIN, SERVICE_SEND_PIN
|
||||
from .coordinator import BlinkUpdateCoordinator
|
||||
|
||||
SERVICE_UPDATE_SCHEMA = vol.Schema(
|
||||
|
@ -93,33 +89,9 @@ def setup_services(hass: HomeAssistant) -> None:
|
|||
call.data[CONF_PIN],
|
||||
)
|
||||
|
||||
async def blink_refresh(call: ServiceCall):
|
||||
"""Call blink to refresh info."""
|
||||
ir.async_create_issue(
|
||||
hass,
|
||||
DOMAIN,
|
||||
"service_deprecation",
|
||||
breaks_in_ha_version="2024.7.0",
|
||||
is_fixable=True,
|
||||
is_persistent=True,
|
||||
severity=ir.IssueSeverity.WARNING,
|
||||
translation_key="service_deprecation",
|
||||
)
|
||||
|
||||
for coordinator in collect_coordinators(call.data[ATTR_DEVICE_ID]):
|
||||
await coordinator.api.refresh(force_cache=True)
|
||||
|
||||
# Register all the above services
|
||||
# Refresh service is deprecated and will be removed in 7/2024
|
||||
service_mapping = [
|
||||
(blink_refresh, SERVICE_REFRESH, SERVICE_UPDATE_SCHEMA),
|
||||
(send_pin, SERVICE_SEND_PIN, SERVICE_SEND_PIN_SCHEMA),
|
||||
]
|
||||
|
||||
for service_handler, service_name, schema in service_mapping:
|
||||
hass.services.async_register(
|
||||
DOMAIN,
|
||||
service_name,
|
||||
service_handler,
|
||||
schema=schema,
|
||||
)
|
||||
hass.services.async_register(
|
||||
DOMAIN,
|
||||
SERVICE_SEND_PIN,
|
||||
send_pin,
|
||||
schema=SERVICE_SEND_PIN_SCHEMA,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue