diff --git a/homeassistant/components/abode/services.py b/homeassistant/components/abode/services.py index ffbdeb326f9..7862b3e6dfe 100644 --- a/homeassistant/components/abode/services.py +++ b/homeassistant/components/abode/services.py @@ -6,7 +6,7 @@ from jaraco.abode.exceptions import Exception as AbodeException import voluptuous as vol from homeassistant.const import ATTR_ENTITY_ID -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import config_validation as cv from homeassistant.helpers.dispatcher import dispatcher_send @@ -70,6 +70,7 @@ def _trigger_automation(call: ServiceCall) -> None: dispatcher_send(call.hass, signal) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Home Assistant services.""" diff --git a/homeassistant/components/amcrest/services.py b/homeassistant/components/amcrest/services.py index 1ba869ce2d5..084761c4978 100644 --- a/homeassistant/components/amcrest/services.py +++ b/homeassistant/components/amcrest/services.py @@ -5,7 +5,7 @@ from __future__ import annotations from homeassistant.auth.models import User from homeassistant.auth.permissions.const import POLICY_CONTROL from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, ENTITY_MATCH_NONE -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.exceptions import Unauthorized, UnknownUser from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.helpers.service import async_extract_entity_ids @@ -15,6 +15,7 @@ from .const import CAMERAS, DATA_AMCREST, DOMAIN from .helpers import service_signal +@callback def async_setup_services(hass: HomeAssistant) -> None: """Set up the Amcrest IP Camera services.""" diff --git a/homeassistant/components/downloader/services.py b/homeassistant/components/downloader/services.py index 19f6e827fb0..7f651c6b1f9 100644 --- a/homeassistant/components/downloader/services.py +++ b/homeassistant/components/downloader/services.py @@ -10,7 +10,7 @@ import threading import requests import voluptuous as vol -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import config_validation as cv from homeassistant.helpers.service import async_register_admin_service from homeassistant.util import raise_if_invalid_filename, raise_if_invalid_path @@ -141,6 +141,7 @@ def download_file(service: ServiceCall) -> None: threading.Thread(target=do_download).start() +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register the services for the downloader component.""" async_register_admin_service( diff --git a/homeassistant/components/elkm1/services.py b/homeassistant/components/elkm1/services.py index 622ce65ae5e..bfdd968680c 100644 --- a/homeassistant/components/elkm1/services.py +++ b/homeassistant/components/elkm1/services.py @@ -63,6 +63,7 @@ def _set_time_service(service: ServiceCall) -> None: _async_get_elk_panel(service).set_time(dt_util.now()) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Create ElkM1 services.""" diff --git a/homeassistant/components/ffmpeg/services.py b/homeassistant/components/ffmpeg/services.py index ad7946869ec..6b522799f4f 100644 --- a/homeassistant/components/ffmpeg/services.py +++ b/homeassistant/components/ffmpeg/services.py @@ -5,7 +5,7 @@ from __future__ import annotations import voluptuous as vol from homeassistant.const import ATTR_ENTITY_ID -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import config_validation as cv from homeassistant.helpers.dispatcher import async_dispatcher_send @@ -35,6 +35,7 @@ async def _async_service_handle(service: ServiceCall) -> None: async_dispatcher_send(service.hass, SIGNAL_FFMPEG_RESTART, entity_ids) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register FFmpeg services.""" diff --git a/homeassistant/components/google_assistant_sdk/services.py b/homeassistant/components/google_assistant_sdk/services.py index 7f0227bf040..981f4d8ba5c 100644 --- a/homeassistant/components/google_assistant_sdk/services.py +++ b/homeassistant/components/google_assistant_sdk/services.py @@ -11,6 +11,7 @@ from homeassistant.core import ( ServiceCall, ServiceResponse, SupportsResponse, + callback, ) from homeassistant.helpers import config_validation as cv @@ -49,6 +50,7 @@ async def _send_text_command(call: ServiceCall) -> ServiceResponse: return None +@callback def async_setup_services(hass: HomeAssistant) -> None: """Add the services for Google Assistant SDK.""" diff --git a/homeassistant/components/google_photos/services.py b/homeassistant/components/google_photos/services.py index ab4fb86af5a..a74fabb3b77 100644 --- a/homeassistant/components/google_photos/services.py +++ b/homeassistant/components/google_photos/services.py @@ -16,6 +16,7 @@ from homeassistant.core import ( ServiceCall, ServiceResponse, SupportsResponse, + callback, ) from homeassistant.exceptions import HomeAssistantError, ServiceValidationError from homeassistant.helpers import config_validation as cv @@ -77,6 +78,7 @@ def _read_file_contents( return results +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register Google Photos services.""" diff --git a/homeassistant/components/google_sheets/services.py b/homeassistant/components/google_sheets/services.py index ea0c1e5a4ed..6425aec4eb0 100644 --- a/homeassistant/components/google_sheets/services.py +++ b/homeassistant/components/google_sheets/services.py @@ -13,7 +13,7 @@ from gspread.utils import ValueInputOption import voluptuous as vol from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import config_validation as cv from homeassistant.helpers.selector import ConfigEntrySelector @@ -76,6 +76,7 @@ async def _async_append_to_sheet(call: ServiceCall) -> None: await call.hass.async_add_executor_job(_append_to_sheet, call, entry) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Add the services for Google Sheets.""" diff --git a/homeassistant/components/habitica/services.py b/homeassistant/components/habitica/services.py index 8ef12a38f1c..c5207ae4ec0 100644 --- a/homeassistant/components/habitica/services.py +++ b/homeassistant/components/habitica/services.py @@ -35,6 +35,7 @@ from homeassistant.core import ( ServiceCall, ServiceResponse, SupportsResponse, + callback, ) from homeassistant.exceptions import HomeAssistantError, ServiceValidationError from homeassistant.helpers import config_validation as cv @@ -249,6 +250,7 @@ def get_config_entry(hass: HomeAssistant, entry_id: str) -> HabiticaConfigEntry: return entry +@callback def async_setup_services(hass: HomeAssistant) -> None: # noqa: C901 """Set up services for Habitica integration.""" diff --git a/homeassistant/components/hue/services.py b/homeassistant/components/hue/services.py index 3fcf4aa45f9..0fd6e8bdae0 100644 --- a/homeassistant/components/hue/services.py +++ b/homeassistant/components/hue/services.py @@ -8,7 +8,7 @@ import logging from aiohue import HueBridgeV1, HueBridgeV2 import voluptuous as vol -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import config_validation as cv from homeassistant.helpers.service import verify_domain_control @@ -25,6 +25,7 @@ from .const import ( LOGGER = logging.getLogger(__name__) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register services for Hue integration.""" diff --git a/homeassistant/components/icloud/services.py b/homeassistant/components/icloud/services.py index 6262710460f..dbb843e8216 100644 --- a/homeassistant/components/icloud/services.py +++ b/homeassistant/components/icloud/services.py @@ -4,7 +4,7 @@ from __future__ import annotations import voluptuous as vol -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import config_validation as cv from homeassistant.util import slugify @@ -115,6 +115,7 @@ def _get_account(hass: HomeAssistant, account_identifier: str) -> IcloudAccount: return icloud_account +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register iCloud services.""" diff --git a/homeassistant/components/jewish_calendar/services.py b/homeassistant/components/jewish_calendar/services.py index a065ee9c969..6fdebe6f74d 100644 --- a/homeassistant/components/jewish_calendar/services.py +++ b/homeassistant/components/jewish_calendar/services.py @@ -15,6 +15,7 @@ from homeassistant.core import ( ServiceCall, ServiceResponse, SupportsResponse, + callback, ) from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import config_validation as cv @@ -39,6 +40,7 @@ OMER_SCHEMA = vol.Schema( ) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Set up the Jewish Calendar services.""" diff --git a/homeassistant/components/lcn/services.py b/homeassistant/components/lcn/services.py index ef6343bdfef..33550d9785d 100644 --- a/homeassistant/components/lcn/services.py +++ b/homeassistant/components/lcn/services.py @@ -16,6 +16,7 @@ from homeassistant.core import ( ServiceCall, ServiceResponse, SupportsResponse, + callback, ) from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import config_validation as cv, device_registry as dr @@ -438,6 +439,7 @@ SERVICES = ( ) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register services for LCN.""" for service_name, service in SERVICES: diff --git a/homeassistant/components/nordpool/services.py b/homeassistant/components/nordpool/services.py index 628962811e3..9bb97d0737b 100644 --- a/homeassistant/components/nordpool/services.py +++ b/homeassistant/components/nordpool/services.py @@ -22,6 +22,7 @@ from homeassistant.core import ( ServiceCall, ServiceResponse, SupportsResponse, + callback, ) from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import config_validation as cv @@ -66,6 +67,7 @@ def get_config_entry(hass: HomeAssistant, entry_id: str) -> NordPoolConfigEntry: return entry +@callback def async_setup_services(hass: HomeAssistant) -> None: """Set up services for Nord Pool integration.""" diff --git a/homeassistant/components/nzbget/services.py b/homeassistant/components/nzbget/services.py index 1072000cfea..ebcdd362b0c 100644 --- a/homeassistant/components/nzbget/services.py +++ b/homeassistant/components/nzbget/services.py @@ -2,7 +2,7 @@ import voluptuous as vol -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 @@ -48,6 +48,7 @@ def set_speed(call: ServiceCall) -> None: _get_coordinator(call).nzbget.rate(call.data[ATTR_SPEED]) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register integration-level services.""" diff --git a/homeassistant/components/ohme/services.py b/homeassistant/components/ohme/services.py index 8ed29aa373d..bebfe718095 100644 --- a/homeassistant/components/ohme/services.py +++ b/homeassistant/components/ohme/services.py @@ -11,6 +11,7 @@ from homeassistant.core import ( ServiceCall, ServiceResponse, SupportsResponse, + callback, ) from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import selector @@ -70,6 +71,7 @@ def __get_client(call: ServiceCall) -> OhmeApiClient: return entry.runtime_data.charge_session_coordinator.client +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register services.""" diff --git a/homeassistant/components/onedrive/services.py b/homeassistant/components/onedrive/services.py index f29133a4ca4..971a4da1f6b 100644 --- a/homeassistant/components/onedrive/services.py +++ b/homeassistant/components/onedrive/services.py @@ -16,6 +16,7 @@ from homeassistant.core import ( ServiceCall, ServiceResponse, SupportsResponse, + callback, ) from homeassistant.exceptions import HomeAssistantError, ServiceValidationError from homeassistant.helpers import config_validation as cv @@ -70,6 +71,7 @@ def _read_file_contents( return results +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register OneDrive services.""" diff --git a/homeassistant/components/onkyo/services.py b/homeassistant/components/onkyo/services.py index e602c5a24e0..26a22523a0e 100644 --- a/homeassistant/components/onkyo/services.py +++ b/homeassistant/components/onkyo/services.py @@ -8,7 +8,7 @@ import voluptuous as vol from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER_DOMAIN from homeassistant.const import ATTR_ENTITY_ID -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import config_validation as cv from homeassistant.util.hass_dict import HassKey @@ -40,6 +40,7 @@ ONKYO_SELECT_OUTPUT_SCHEMA = vol.Schema( SERVICE_SELECT_HDMI_OUTPUT = "onkyo_select_hdmi_output" +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register Onkyo services.""" diff --git a/homeassistant/components/opentherm_gw/services.py b/homeassistant/components/opentherm_gw/services.py index c8f5c748875..5031393e867 100644 --- a/homeassistant/components/opentherm_gw/services.py +++ b/homeassistant/components/opentherm_gw/services.py @@ -15,7 +15,7 @@ from homeassistant.const import ( ATTR_TEMPERATURE, ATTR_TIME, ) -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 @@ -61,6 +61,7 @@ def _get_gateway(call: ServiceCall) -> OpenThermGatewayHub: return gw_hub +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register services for the component.""" service_reset_schema = vol.Schema({vol.Required(ATTR_GW_ID): vol.All(cv.string)}) diff --git a/homeassistant/components/picnic/services.py b/homeassistant/components/picnic/services.py index 0717b669da3..8ecae8dc301 100644 --- a/homeassistant/components/picnic/services.py +++ b/homeassistant/components/picnic/services.py @@ -7,7 +7,7 @@ from typing import cast from python_picnic_api2 import PicnicAPI import voluptuous as vol -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import config_validation as cv from .const import ( @@ -26,6 +26,7 @@ class PicnicServiceException(Exception): """Exception for Picnic services.""" +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register services for the Picnic integration, if not registered yet.""" diff --git a/homeassistant/components/ps4/services.py b/homeassistant/components/ps4/services.py index 88751660f75..583366602ed 100644 --- a/homeassistant/components/ps4/services.py +++ b/homeassistant/components/ps4/services.py @@ -5,7 +5,7 @@ from __future__ import annotations import voluptuous as vol from homeassistant.const import ATTR_COMMAND, ATTR_ENTITY_ID -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.helpers import config_validation as cv from .const import COMMANDS, DOMAIN, PS4_DATA @@ -29,6 +29,7 @@ async def async_service_command(call: ServiceCall) -> None: await device.async_send_command(command) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Handle for services.""" diff --git a/homeassistant/components/teslemetry/services.py b/homeassistant/components/teslemetry/services.py index d989e7b8f40..246cc097a2a 100644 --- a/homeassistant/components/teslemetry/services.py +++ b/homeassistant/components/teslemetry/services.py @@ -7,7 +7,7 @@ from voluptuous import All, Range from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_DEVICE_ID, CONF_LATITUDE, CONF_LONGITUDE -from homeassistant.core import HomeAssistant, ServiceCall +from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.exceptions import HomeAssistantError, ServiceValidationError from homeassistant.helpers import config_validation as cv, device_registry as dr @@ -98,6 +98,7 @@ def async_get_energy_site_for_entry( return energy_data +@callback def async_setup_services(hass: HomeAssistant) -> None: """Set up the Teslemetry services.""" diff --git a/homeassistant/components/unifiprotect/services.py b/homeassistant/components/unifiprotect/services.py index 402aae2eeba..40fe0a991f2 100644 --- a/homeassistant/components/unifiprotect/services.py +++ b/homeassistant/components/unifiprotect/services.py @@ -303,6 +303,7 @@ SERVICES = [ ] +@callback def async_setup_services(hass: HomeAssistant) -> None: """Set up the global UniFi Protect services.""" diff --git a/homeassistant/components/yolink/services.py b/homeassistant/components/yolink/services.py index 10d90d274a4..5bc5f2f9660 100644 --- a/homeassistant/components/yolink/services.py +++ b/homeassistant/components/yolink/services.py @@ -4,7 +4,7 @@ import voluptuous as vol from yolink.client_request import ClientRequest from homeassistant.config_entries import ConfigEntryState -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, device_registry as dr @@ -25,6 +25,7 @@ _SPEAKER_HUB_PLAY_CALL_OPTIONAL_ATTRS = ( ) +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register services for YoLink integration.""" diff --git a/homeassistant/components/zwave_js/services.py b/homeassistant/components/zwave_js/services.py index 33195fe6c8b..076e3b6a50d 100644 --- a/homeassistant/components/zwave_js/services.py +++ b/homeassistant/components/zwave_js/services.py @@ -58,6 +58,7 @@ TARGET_VALIDATORS = { } +@callback def async_setup_services(hass: HomeAssistant) -> None: """Register integration services.""" services = ZWaveServices(hass, er.async_get(hass), dr.async_get(hass))