mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Mark async_setup_services as callback (#146617)
This commit is contained in:
parent
e14cf8a5b9
commit
14c30ef2df
@ -33,7 +33,7 @@ CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
|
|||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
"""Set up fritzboxtools integration."""
|
"""Set up fritzboxtools integration."""
|
||||||
await async_setup_services(hass)
|
async_setup_services(hass)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ from fritzconnection.core.exceptions import (
|
|||||||
from fritzconnection.lib.fritzwlan import DEFAULT_PASSWORD_LENGTH
|
from fritzconnection.lib.fritzwlan import DEFAULT_PASSWORD_LENGTH
|
||||||
import voluptuous as vol
|
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.exceptions import HomeAssistantError, ServiceValidationError
|
||||||
from homeassistant.helpers.service import async_extract_config_entry_ids
|
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
|
) from ex
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_services(hass: HomeAssistant) -> None:
|
@callback
|
||||||
|
def async_setup_services(hass: HomeAssistant) -> None:
|
||||||
"""Set up services for Fritz integration."""
|
"""Set up services for Fritz integration."""
|
||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
|
@ -63,7 +63,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
await async_setup_services(hass)
|
async_setup_services(hass)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ from homematicip.group import HeatingGroup
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, ATTR_TEMPERATURE
|
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.exceptions import ServiceValidationError
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
from homeassistant.helpers.config_validation import comp_entity_ids
|
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."""
|
"""Set up the HomematicIP Cloud services."""
|
||||||
|
|
||||||
@verify_domain_control(hass, DOMAIN)
|
@verify_domain_control(hass, DOMAIN)
|
||||||
|
@ -105,7 +105,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
)
|
)
|
||||||
hass.data.setdefault(DOMAIN, hass_data)
|
hass.data.setdefault(DOMAIN, hass_data)
|
||||||
|
|
||||||
await async_setup_services(hass)
|
async_setup_services(hass)
|
||||||
|
|
||||||
hass.http.register_view(PlexImageView())
|
hass.http.register_view(PlexImageView())
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ from plexapi.exceptions import NotFound
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from yarl import URL
|
from yarl import URL
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant, ServiceCall
|
from homeassistant.core import HomeAssistant, ServiceCall, callback
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
|
||||||
from .const import DOMAIN, PLEX_URI_SCHEME, SERVERS, SERVICE_REFRESH_LIBRARY
|
from .const import DOMAIN, PLEX_URI_SCHEME, SERVERS, SERVICE_REFRESH_LIBRARY
|
||||||
@ -23,7 +23,8 @@ REFRESH_LIBRARY_SCHEMA = vol.Schema(
|
|||||||
_LOGGER = logging.getLogger(__package__)
|
_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."""
|
"""Set up services for the Plex component."""
|
||||||
|
|
||||||
async def async_refresh_library_service(service_call: ServiceCall) -> None:
|
async def async_refresh_library_service(service_call: ServiceCall) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user