Mark async_setup_services as callback (#146617)

This commit is contained in:
epenet 2025-06-12 11:34:56 +02:00 committed by GitHub
parent e14cf8a5b9
commit 14c30ef2df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12 additions and 9 deletions

View File

@ -33,7 +33,7 @@ CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up fritzboxtools integration."""
await async_setup_services(hass)
async_setup_services(hass)
return True

View File

@ -10,7 +10,7 @@ from fritzconnection.core.exceptions import (
from fritzconnection.lib.fritzwlan import DEFAULT_PASSWORD_LENGTH
import voluptuous as vol
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.helpers.service import async_extract_config_entry_ids
@ -64,7 +64,8 @@ async def _async_set_guest_wifi_password(service_call: ServiceCall) -> None:
) from ex
async def async_setup_services(hass: HomeAssistant) -> None:
@callback
def async_setup_services(hass: HomeAssistant) -> None:
"""Set up services for Fritz integration."""
hass.services.async_register(

View File

@ -63,7 +63,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
)
)
await async_setup_services(hass)
async_setup_services(hass)
return True

View File

@ -12,7 +12,7 @@ from homematicip.group import HeatingGroup
import voluptuous as vol
from homeassistant.const import ATTR_ENTITY_ID, ATTR_TEMPERATURE
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.config_validation import comp_entity_ids
@ -120,7 +120,8 @@ SCHEMA_SET_HOME_COOLING_MODE = vol.Schema(
)
async def async_setup_services(hass: HomeAssistant) -> None:
@callback
def async_setup_services(hass: HomeAssistant) -> None:
"""Set up the HomematicIP Cloud services."""
@verify_domain_control(hass, DOMAIN)

View File

@ -105,7 +105,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
)
hass.data.setdefault(DOMAIN, hass_data)
await async_setup_services(hass)
async_setup_services(hass)
hass.http.register_view(PlexImageView())

View File

@ -7,7 +7,7 @@ from plexapi.exceptions import NotFound
import voluptuous as vol
from yarl import URL
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import HomeAssistantError
from .const import DOMAIN, PLEX_URI_SCHEME, SERVERS, SERVICE_REFRESH_LIBRARY
@ -23,7 +23,8 @@ REFRESH_LIBRARY_SCHEMA = vol.Schema(
_LOGGER = logging.getLogger(__package__)
async def async_setup_services(hass: HomeAssistant) -> None:
@callback
def async_setup_services(hass: HomeAssistant) -> None:
"""Set up services for the Plex component."""
async def async_refresh_library_service(service_call: ServiceCall) -> None: