diff --git a/homeassistant/components/downloader/__init__.py b/homeassistant/components/downloader/__init__.py index c4fc8d2f500..eb844ad8d3f 100644 --- a/homeassistant/components/downloader/__init__.py +++ b/homeassistant/components/downloader/__init__.py @@ -8,7 +8,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from .const import _LOGGER, CONF_DOWNLOAD_DIR -from .services import register_services +from .services import async_setup_services async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: @@ -25,6 +25,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: ) return False - register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/downloader/services.py b/homeassistant/components/downloader/services.py index a8bcba605d9..19f6e827fb0 100644 --- a/homeassistant/components/downloader/services.py +++ b/homeassistant/components/downloader/services.py @@ -141,7 +141,7 @@ def download_file(service: ServiceCall) -> None: threading.Thread(target=do_download).start() -def register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register the services for the downloader component.""" async_register_admin_service( hass, diff --git a/homeassistant/components/google_photos/__init__.py b/homeassistant/components/google_photos/__init__.py index 897598fa5cb..08bdce9b359 100644 --- a/homeassistant/components/google_photos/__init__.py +++ b/homeassistant/components/google_photos/__init__.py @@ -14,7 +14,7 @@ from homeassistant.helpers.typing import ConfigType from . import api from .const import DOMAIN from .coordinator import GooglePhotosConfigEntry, GooglePhotosUpdateCoordinator -from .services import async_register_services +from .services import async_setup_services __all__ = ["DOMAIN"] @@ -24,7 +24,7 @@ CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up Google Photos integration.""" - async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/google_photos/services.py b/homeassistant/components/google_photos/services.py index 8b065ad34ac..ab4fb86af5a 100644 --- a/homeassistant/components/google_photos/services.py +++ b/homeassistant/components/google_photos/services.py @@ -77,7 +77,7 @@ def _read_file_contents( return results -def async_register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register Google Photos services.""" async def async_handle_upload(call: ServiceCall) -> ServiceResponse: diff --git a/homeassistant/components/hue/__init__.py b/homeassistant/components/hue/__init__.py index cf2c1101b17..f26b11707c2 100644 --- a/homeassistant/components/hue/__init__.py +++ b/homeassistant/components/hue/__init__.py @@ -11,7 +11,7 @@ from homeassistant.helpers.typing import ConfigType from .bridge import HueBridge, HueConfigEntry from .const import DOMAIN from .migration import check_migration -from .services import async_register_services +from .services import async_setup_services CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) @@ -19,7 +19,7 @@ CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up Hue integration.""" - async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/hue/services.py b/homeassistant/components/hue/services.py index 6639795d277..3fcf4aa45f9 100644 --- a/homeassistant/components/hue/services.py +++ b/homeassistant/components/hue/services.py @@ -25,7 +25,7 @@ from .const import ( LOGGER = logging.getLogger(__name__) -def async_register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register services for Hue integration.""" async def hue_activate_scene(call: ServiceCall, skip_reload=True) -> None: diff --git a/homeassistant/components/icloud/__init__.py b/homeassistant/components/icloud/__init__.py index 96349274dce..16baa9fcb7d 100644 --- a/homeassistant/components/icloud/__init__.py +++ b/homeassistant/components/icloud/__init__.py @@ -20,7 +20,7 @@ from .const import ( STORAGE_KEY, STORAGE_VERSION, ) -from .services import register_services +from .services import async_setup_services CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) @@ -28,7 +28,7 @@ CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up iCloud integration.""" - register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/icloud/services.py b/homeassistant/components/icloud/services.py index 5897fcb06f7..6262710460f 100644 --- a/homeassistant/components/icloud/services.py +++ b/homeassistant/components/icloud/services.py @@ -115,8 +115,8 @@ def _get_account(hass: HomeAssistant, account_identifier: str) -> IcloudAccount: return icloud_account -def register_services(hass: HomeAssistant) -> None: - """Set up an iCloud account from a config entry.""" +def async_setup_services(hass: HomeAssistant) -> None: + """Register iCloud services.""" hass.services.async_register( DOMAIN, SERVICE_ICLOUD_PLAY_SOUND, play_sound, schema=SERVICE_SCHEMA_PLAY_SOUND diff --git a/homeassistant/components/insteon/__init__.py b/homeassistant/components/insteon/__init__.py index 7d30c4c2bf7..1a1306c2a2f 100644 --- a/homeassistant/components/insteon/__init__.py +++ b/homeassistant/components/insteon/__init__.py @@ -25,7 +25,7 @@ from .const import ( DOMAIN, INSTEON_PLATFORMS, ) -from .services import async_register_services +from .services import async_setup_services from .utils import ( add_insteon_events, get_device_platforms, @@ -145,7 +145,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: _LOGGER.debug("Insteon device count: %s", len(devices)) register_new_device_callback(hass) - async_register_services(hass) + async_setup_services(hass) create_insteon_device(hass, devices.modem, entry.entry_id) diff --git a/homeassistant/components/insteon/services.py b/homeassistant/components/insteon/services.py index 969d11e1f42..eb671a720ad 100644 --- a/homeassistant/components/insteon/services.py +++ b/homeassistant/components/insteon/services.py @@ -86,7 +86,7 @@ _LOGGER = logging.getLogger(__name__) @callback -def async_register_services(hass: HomeAssistant) -> None: # noqa: C901 +def async_setup_services(hass: HomeAssistant) -> None: # noqa: C901 """Register services used by insteon component.""" save_lock = asyncio.Lock() diff --git a/homeassistant/components/lcn/__init__.py b/homeassistant/components/lcn/__init__.py index b3d2c14794c..11cee726eb0 100644 --- a/homeassistant/components/lcn/__init__.py +++ b/homeassistant/components/lcn/__init__.py @@ -59,7 +59,7 @@ from .helpers import ( register_lcn_address_devices, register_lcn_host_device, ) -from .services import register_services +from .services import async_setup_services from .websocket import register_panel_and_ws_api _LOGGER = logging.getLogger(__name__) @@ -71,7 +71,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the LCN component.""" hass.data.setdefault(DOMAIN, {}) - await register_services(hass) + async_setup_services(hass) await register_panel_and_ws_api(hass) return True diff --git a/homeassistant/components/lcn/services.py b/homeassistant/components/lcn/services.py index fdc5359d300..ef6343bdfef 100644 --- a/homeassistant/components/lcn/services.py +++ b/homeassistant/components/lcn/services.py @@ -438,7 +438,7 @@ SERVICES = ( ) -async def register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register services for LCN.""" for service_name, service in SERVICES: hass.services.async_register( diff --git a/homeassistant/components/nzbget/__init__.py b/homeassistant/components/nzbget/__init__.py index cb4350b68d5..5060e6ad024 100644 --- a/homeassistant/components/nzbget/__init__.py +++ b/homeassistant/components/nzbget/__init__.py @@ -8,7 +8,7 @@ from homeassistant.helpers.typing import ConfigType from .const import DATA_COORDINATOR, DATA_UNDO_UPDATE_LISTENER, DOMAIN from .coordinator import NZBGetDataUpdateCoordinator -from .services import async_register_services +from .services import async_setup_services CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) PLATFORMS = [Platform.SENSOR, Platform.SWITCH] @@ -17,7 +17,7 @@ PLATFORMS = [Platform.SENSOR, Platform.SWITCH] async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up NZBGet integration.""" - async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/nzbget/services.py b/homeassistant/components/nzbget/services.py index afa6f06d086..1072000cfea 100644 --- a/homeassistant/components/nzbget/services.py +++ b/homeassistant/components/nzbget/services.py @@ -48,7 +48,7 @@ def set_speed(call: ServiceCall) -> None: _get_coordinator(call).nzbget.rate(call.data[ATTR_SPEED]) -def async_register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register integration-level services.""" hass.services.async_register(DOMAIN, SERVICE_PAUSE, pause, schema=vol.Schema({})) diff --git a/homeassistant/components/onedrive/__init__.py b/homeassistant/components/onedrive/__init__.py index f5d841683d5..ab9255f832e 100644 --- a/homeassistant/components/onedrive/__init__.py +++ b/homeassistant/components/onedrive/__init__.py @@ -34,7 +34,7 @@ from .coordinator import ( OneDriveRuntimeData, OneDriveUpdateCoordinator, ) -from .services import async_register_services +from .services import async_setup_services CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) PLATFORMS = [Platform.SENSOR] @@ -44,7 +44,7 @@ _LOGGER = logging.getLogger(__name__) async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the OneDrive integration.""" - async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/onedrive/services.py b/homeassistant/components/onedrive/services.py index 0b1afe925d2..f29133a4ca4 100644 --- a/homeassistant/components/onedrive/services.py +++ b/homeassistant/components/onedrive/services.py @@ -70,7 +70,7 @@ def _read_file_contents( return results -def async_register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register OneDrive services.""" async def async_handle_upload(call: ServiceCall) -> ServiceResponse: diff --git a/homeassistant/components/onkyo/__init__.py b/homeassistant/components/onkyo/__init__.py index 2ebe86da561..67ed4162778 100644 --- a/homeassistant/components/onkyo/__init__.py +++ b/homeassistant/components/onkyo/__init__.py @@ -18,7 +18,7 @@ from .const import ( ListeningMode, ) from .receiver import Receiver, async_interview -from .services import DATA_MP_ENTITIES, async_register_services +from .services import DATA_MP_ENTITIES, async_setup_services _LOGGER = logging.getLogger(__name__) @@ -41,7 +41,7 @@ type OnkyoConfigEntry = ConfigEntry[OnkyoData] async def async_setup(hass: HomeAssistant, _: ConfigType) -> bool: """Set up Onkyo component.""" - await async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/onkyo/services.py b/homeassistant/components/onkyo/services.py index d875d8287fe..e602c5a24e0 100644 --- a/homeassistant/components/onkyo/services.py +++ b/homeassistant/components/onkyo/services.py @@ -40,7 +40,7 @@ ONKYO_SELECT_OUTPUT_SCHEMA = vol.Schema( SERVICE_SELECT_HDMI_OUTPUT = "onkyo_select_hdmi_output" -async def async_register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register Onkyo services.""" hass.data.setdefault(DATA_MP_ENTITIES, {}) diff --git a/homeassistant/components/picnic/__init__.py b/homeassistant/components/picnic/__init__.py index 2d1c05c8b1a..bf9bb61b539 100644 --- a/homeassistant/components/picnic/__init__.py +++ b/homeassistant/components/picnic/__init__.py @@ -10,7 +10,7 @@ from homeassistant.helpers.typing import ConfigType from .const import CONF_API, CONF_COORDINATOR, DOMAIN from .coordinator import PicnicUpdateCoordinator -from .services import async_register_services +from .services import async_setup_services CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) PLATFORMS = [Platform.SENSOR, Platform.TODO] @@ -19,7 +19,7 @@ PLATFORMS = [Platform.SENSOR, Platform.TODO] async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up Picnic integration.""" - await async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/picnic/services.py b/homeassistant/components/picnic/services.py index 9496a9441e5..0717b669da3 100644 --- a/homeassistant/components/picnic/services.py +++ b/homeassistant/components/picnic/services.py @@ -26,7 +26,7 @@ class PicnicServiceException(Exception): """Exception for Picnic services.""" -async def async_register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register services for the Picnic integration, if not registered yet.""" async def async_add_product_service(call: ServiceCall): diff --git a/homeassistant/components/ps4/__init__.py b/homeassistant/components/ps4/__init__.py index ddde4620871..48e7bf92d0f 100644 --- a/homeassistant/components/ps4/__init__.py +++ b/homeassistant/components/ps4/__init__.py @@ -29,7 +29,7 @@ from homeassistant.util.json import JsonObjectType, load_json_object from .config_flow import PlayStation4FlowHandler # noqa: F401 from .const import ATTR_MEDIA_IMAGE_URL, COUNTRYCODE_NAMES, DOMAIN, GAMES_FILE, PS4_DATA -from .services import register_services +from .services import async_setup_services if TYPE_CHECKING: from .media_player import PS4Device @@ -58,7 +58,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: protocol=protocol, ) _LOGGER.debug("PS4 DDP endpoint created: %s, %s", transport, protocol) - register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/ps4/services.py b/homeassistant/components/ps4/services.py index 7da3cb0ae93..88751660f75 100644 --- a/homeassistant/components/ps4/services.py +++ b/homeassistant/components/ps4/services.py @@ -29,7 +29,7 @@ async def async_service_command(call: ServiceCall) -> None: await device.async_send_command(command) -def register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Handle for services.""" hass.services.async_register( diff --git a/homeassistant/components/teslemetry/__init__.py b/homeassistant/components/teslemetry/__init__.py index 5d9a757b9e6..49af8c1a08d 100644 --- a/homeassistant/components/teslemetry/__init__.py +++ b/homeassistant/components/teslemetry/__init__.py @@ -32,7 +32,7 @@ from .coordinator import ( ) from .helpers import flatten from .models import TeslemetryData, TeslemetryEnergyData, TeslemetryVehicleData -from .services import async_register_services +from .services import async_setup_services PLATFORMS: Final = [ Platform.BINARY_SENSOR, @@ -56,7 +56,7 @@ CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Telemetry integration.""" - async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/teslemetry/services.py b/homeassistant/components/teslemetry/services.py index 2f21073d227..d989e7b8f40 100644 --- a/homeassistant/components/teslemetry/services.py +++ b/homeassistant/components/teslemetry/services.py @@ -98,7 +98,7 @@ def async_get_energy_site_for_entry( return energy_data -def async_register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Set up the Teslemetry services.""" async def navigate_gps_request(call: ServiceCall) -> None: diff --git a/homeassistant/components/yolink/__init__.py b/homeassistant/components/yolink/__init__.py index 3dd5aa7c974..7132fd6a414 100644 --- a/homeassistant/components/yolink/__init__.py +++ b/homeassistant/components/yolink/__init__.py @@ -29,7 +29,7 @@ from . import api from .const import ATTR_LORA_INFO, DOMAIN, YOLINK_EVENT from .coordinator import YoLinkCoordinator from .device_trigger import CONF_LONG_PRESS, CONF_SHORT_PRESS -from .services import async_register_services +from .services import async_setup_services SCAN_INTERVAL = timedelta(minutes=5) @@ -111,7 +111,7 @@ class YoLinkHomeStore: async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up YoLink.""" - async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/yolink/services.py b/homeassistant/components/yolink/services.py index f17408a7005..10d90d274a4 100644 --- a/homeassistant/components/yolink/services.py +++ b/homeassistant/components/yolink/services.py @@ -25,7 +25,7 @@ _SPEAKER_HUB_PLAY_CALL_OPTIONAL_ATTRS = ( ) -def async_register_services(hass: HomeAssistant) -> None: +def async_setup_services(hass: HomeAssistant) -> None: """Register services for YoLink integration.""" async def handle_speaker_hub_play_call(service_call: ServiceCall) -> None: