diff --git a/homeassistant/components/switchbot_cloud/__init__.py b/homeassistant/components/switchbot_cloud/__init__.py index 53cc147d7879..d35b83338e67 100644 --- a/homeassistant/components/switchbot_cloud/__init__.py +++ b/homeassistant/components/switchbot_cloud/__init__.py @@ -28,7 +28,7 @@ from homeassistant.helpers.typing import ConfigType from .const import CONF_CLOUDHOOK_URL, DEVICE_SUPPORT_MAP, DOMAIN, ENTRY_TITLE from .coordinator import SwitchBotCoordinator -from .service import async_register_services +from .services import async_setup_services CONFIG_SCHEMA = cv.config_entry_only_config_schema("switchbot_cloud") @@ -280,7 +280,7 @@ async def make_new_device_data( async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Switchbot Cloud.""" - async_register_services(hass) + async_setup_services(hass) return True diff --git a/homeassistant/components/switchbot_cloud/service.py b/homeassistant/components/switchbot_cloud/services.py similarity index 87% rename from homeassistant/components/switchbot_cloud/service.py rename to homeassistant/components/switchbot_cloud/services.py index 70250c8e4023..2924ca7e092d 100644 --- a/homeassistant/components/switchbot_cloud/service.py +++ b/homeassistant/components/switchbot_cloud/services.py @@ -1,11 +1,11 @@ -"""SwitchBot Cloud Custom Service.""" +"""Support for SwitchBot Cloud services.""" from logging import getLogger from switchbot_api import ArtFrameCommands 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, service @@ -49,8 +49,9 @@ async def handle_upload_image(call: ServiceCall) -> None: ) -def async_register_services(hass: HomeAssistant) -> None: - """Async register services.""" +@callback +def async_setup_services(hass: HomeAssistant) -> None: + """Register the SwitchBot Cloud services.""" hass.services.async_register( DOMAIN, AI_ART_FRAME_UPLOAD_IMAGE_SERVICE,