mirror of
https://github.com/home-assistant/core.git
synced 2026-09-12 19:49:41 +01:00
Rename services module in switchbot_cloud (#181152)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
+5
-4
@@ -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,
|
||||
Reference in New Issue
Block a user