mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Ensure service calls are typed [a-j] (#63013)
* Ensure service calls are typed [a-j] * Adjust apns * Adjust arlo Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
c0b9a34901
commit
f724aea0bb
@ -18,7 +18,7 @@ from homeassistant.const import (
|
||||
EVENT_HOMEASSISTANT_STOP,
|
||||
Platform,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.core import HomeAssistant, ServiceCall
|
||||
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.dispatcher import dispatcher_send
|
||||
@ -134,19 +134,19 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
|
||||
def setup_hass_services(hass: HomeAssistant) -> None:
|
||||
"""Home Assistant services."""
|
||||
|
||||
def change_setting(call):
|
||||
def change_setting(call: ServiceCall) -> None:
|
||||
"""Change an Abode system setting."""
|
||||
setting = call.data.get(ATTR_SETTING)
|
||||
value = call.data.get(ATTR_VALUE)
|
||||
setting = call.data[ATTR_SETTING]
|
||||
value = call.data[ATTR_VALUE]
|
||||
|
||||
try:
|
||||
hass.data[DOMAIN].abode.set_setting(setting, value)
|
||||
except AbodeException as ex:
|
||||
LOGGER.warning(ex)
|
||||
|
||||
def capture_image(call):
|
||||
def capture_image(call: ServiceCall) -> None:
|
||||
"""Capture a new image."""
|
||||
entity_ids = call.data.get(ATTR_ENTITY_ID)
|
||||
entity_ids = call.data[ATTR_ENTITY_ID]
|
||||
|
||||
target_entities = [
|
||||
entity_id
|
||||
@ -158,9 +158,9 @@ def setup_hass_services(hass: HomeAssistant) -> None:
|
||||
signal = f"abode_camera_capture_{entity_id}"
|
||||
dispatcher_send(hass, signal)
|
||||
|
||||
def trigger_automation(call):
|
||||
def trigger_automation(call: ServiceCall) -> None:
|
||||
"""Trigger an Abode automation."""
|
||||
entity_ids = call.data.get(ATTR_ENTITY_ID)
|
||||
entity_ids = call.data[ATTR_ENTITY_ID]
|
||||
|
||||
target_entities = [
|
||||
entity_id
|
||||
|
@ -16,6 +16,7 @@ from homeassistant.const import (
|
||||
CONF_PORT,
|
||||
EVENT_HOMEASSISTANT_STOP,
|
||||
)
|
||||
from homeassistant.core import ServiceCall
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
@ -119,7 +120,7 @@ def setup(hass, config):
|
||||
hass.data[DATA_ADS] = ads
|
||||
hass.bus.listen(EVENT_HOMEASSISTANT_STOP, ads.shutdown)
|
||||
|
||||
def handle_write_data_by_name(call):
|
||||
def handle_write_data_by_name(call: ServiceCall) -> None:
|
||||
"""Write a value to the connected ADS device."""
|
||||
ads_var = call.data.get(CONF_ADS_VAR)
|
||||
ads_type = call.data.get(CONF_ADS_TYPE)
|
||||
|
@ -16,6 +16,7 @@ from homeassistant.components.notify import (
|
||||
)
|
||||
from homeassistant.config import load_yaml_config_file
|
||||
from homeassistant.const import ATTR_NAME, CONF_NAME, CONF_PLATFORM
|
||||
from homeassistant.core import ServiceCall
|
||||
from homeassistant.helpers import template as template_helper
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.event import track_state_change
|
||||
@ -188,7 +189,7 @@ class ApnsNotificationService(BaseNotificationService):
|
||||
for device in self.devices.values():
|
||||
_write_device(out, device)
|
||||
|
||||
def register(self, call):
|
||||
def register(self, call: ServiceCall) -> None:
|
||||
"""Register a device to receive push messages."""
|
||||
push_id = call.data.get(ATTR_PUSH_ID)
|
||||
|
||||
@ -204,14 +205,12 @@ class ApnsNotificationService(BaseNotificationService):
|
||||
self.devices[push_id] = device
|
||||
with open(self.yaml_path, "a", encoding="utf8") as out:
|
||||
_write_device(out, device)
|
||||
return True
|
||||
return
|
||||
|
||||
if device != current_device:
|
||||
self.devices[push_id] = device
|
||||
self.write_devices()
|
||||
|
||||
return True
|
||||
|
||||
def send_message(self, message=None, **kwargs):
|
||||
"""Send push message to registered devices."""
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
"""Support for Netgear Arlo IP cameras."""
|
||||
from datetime import timedelta
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
import logging
|
||||
|
||||
from pyarlo import PyArlo
|
||||
@ -7,6 +9,7 @@ from requests.exceptions import ConnectTimeout, HTTPError
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME
|
||||
from homeassistant.core import ServiceCall
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.dispatcher import dispatcher_send
|
||||
from homeassistant.helpers.event import track_time_interval
|
||||
@ -73,7 +76,7 @@ def setup(hass, config):
|
||||
)
|
||||
return False
|
||||
|
||||
def hub_refresh(event_time):
|
||||
def hub_refresh(_: ServiceCall | datetime) -> None:
|
||||
"""Call ArloHub to refresh information."""
|
||||
_LOGGER.debug("Updating Arlo Hub component")
|
||||
hass.data[DATA_ARLO].update(update_cameras=True, update_base_station=True)
|
||||
|
@ -21,6 +21,7 @@ from homeassistant.const import (
|
||||
STATE_OFF,
|
||||
STATE_ON,
|
||||
)
|
||||
from homeassistant.core import ServiceCall
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from .const import DOMAIN, SERVICE_SETALLZONES
|
||||
@ -105,7 +106,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
|
||||
add_entities(devices, True)
|
||||
|
||||
def service_handle(service):
|
||||
def service_handle(service: ServiceCall) -> None:
|
||||
"""Handle for services."""
|
||||
entity_ids = service.data.get(ATTR_ENTITY_ID)
|
||||
source = service.data.get(ATTR_SOURCE)
|
||||
|
@ -1,6 +1,10 @@
|
||||
"""Demo platform for the Device tracker component."""
|
||||
from __future__ import annotations
|
||||
|
||||
import random
|
||||
|
||||
from homeassistant.core import ServiceCall
|
||||
|
||||
from .const import DOMAIN, SERVICE_RANDOMIZE_DEVICE_TRACKER_DATA
|
||||
|
||||
|
||||
@ -21,7 +25,7 @@ def setup_scanner(hass, config, see, discovery_info=None):
|
||||
battery=random.randrange(10, 90),
|
||||
)
|
||||
|
||||
def observe(call=None):
|
||||
def observe(call: ServiceCall | None = None) -> None:
|
||||
"""Observe three entities."""
|
||||
random_see("demo_paulus", "Paulus")
|
||||
random_see("demo_anne_therese", "Anne Therese")
|
||||
|
@ -8,6 +8,7 @@ import threading
|
||||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.core import ServiceCall
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.util import raise_if_invalid_filename, raise_if_invalid_path
|
||||
|
||||
@ -56,7 +57,7 @@ def setup(hass, config):
|
||||
|
||||
return False
|
||||
|
||||
def download_file(service):
|
||||
def download_file(service: ServiceCall) -> None:
|
||||
"""Start thread to download file specified in the URL."""
|
||||
|
||||
def do_download():
|
||||
|
@ -11,6 +11,7 @@ from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
CONF_PORT,
|
||||
)
|
||||
from homeassistant.core import ServiceCall
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.discovery import load_platform
|
||||
|
||||
@ -107,7 +108,7 @@ class EbusdData:
|
||||
_LOGGER.error(err)
|
||||
raise RuntimeError(err) from err
|
||||
|
||||
def write(self, call):
|
||||
def write(self, call: ServiceCall) -> None:
|
||||
"""Call write methon on ebusd."""
|
||||
name = call.data.get("name")
|
||||
value = call.data.get("value")
|
||||
|
@ -23,7 +23,7 @@ from homeassistant.const import (
|
||||
CONF_PORT,
|
||||
CONF_USERNAME,
|
||||
)
|
||||
from homeassistant.core import split_entity_id
|
||||
from homeassistant.core import ServiceCall, split_entity_id
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from .const import DOMAIN, SERVICE_TEACH_FACE
|
||||
@ -187,7 +187,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
hass.data[DATA_FACEBOX].append(facebox)
|
||||
add_entities(entities)
|
||||
|
||||
def service_handle(service):
|
||||
def service_handle(service: ServiceCall) -> None:
|
||||
"""Handle for services."""
|
||||
entity_ids = service.data.get("entity_id")
|
||||
|
||||
|
@ -7,6 +7,7 @@ import voluptuous as vol
|
||||
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN
|
||||
from homeassistant.core import ServiceCall
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@ -51,7 +52,7 @@ def setup(hass, config):
|
||||
"""Set up the Foursquare component."""
|
||||
config = config[DOMAIN]
|
||||
|
||||
def checkin_user(call):
|
||||
def checkin_user(call: ServiceCall) -> None:
|
||||
"""Check a user in on Swarm."""
|
||||
url = f"https://api.foursquare.com/v2/checkins/add?oauth_token={config[CONF_ACCESS_TOKEN]}&v=20160802&m=swarm"
|
||||
response = requests.post(url, data=call.data, timeout=10)
|
||||
|
@ -24,6 +24,7 @@ from homeassistant.const import (
|
||||
CONF_NAME,
|
||||
CONF_OFFSET,
|
||||
)
|
||||
from homeassistant.core import ServiceCall
|
||||
from homeassistant.helpers import discovery
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import generate_entity_id
|
||||
@ -267,7 +268,7 @@ def setup_services(
|
||||
):
|
||||
"""Set up the service listeners."""
|
||||
|
||||
def _found_calendar(call):
|
||||
def _found_calendar(call: ServiceCall) -> None:
|
||||
"""Check if we know about a calendar and generate PLATFORM_DISCOVER."""
|
||||
calendar = get_calendar_info(hass, call.data)
|
||||
if hass.data[DATA_INDEX].get(calendar[CONF_CAL_ID]) is not None:
|
||||
@ -289,7 +290,7 @@ def setup_services(
|
||||
|
||||
hass.services.register(DOMAIN, SERVICE_FOUND_CALENDARS, _found_calendar)
|
||||
|
||||
def _scan_for_calendars(service):
|
||||
def _scan_for_calendars(call: ServiceCall) -> None:
|
||||
"""Scan for new calendars."""
|
||||
service = calendar_service.get()
|
||||
cal_list = service.calendarList()
|
||||
@ -300,7 +301,7 @@ def setup_services(
|
||||
|
||||
hass.services.register(DOMAIN, SERVICE_SCAN_CALENDARS, _scan_for_calendars)
|
||||
|
||||
def _add_event(call):
|
||||
def _add_event(call: ServiceCall) -> None:
|
||||
"""Add a new event to calendar."""
|
||||
service = calendar_service.get()
|
||||
start = {}
|
||||
|
@ -42,7 +42,7 @@ from homeassistant.const import (
|
||||
STATE_PLAYING,
|
||||
STATE_UNAVAILABLE,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.core import HomeAssistant, ServiceCall, callback
|
||||
from homeassistant.helpers import discovery, event
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
@ -230,7 +230,7 @@ def setup(hass: HomeAssistant, base_config: ConfigType) -> bool: # noqa: C901
|
||||
|
||||
hdmi_network.set_initialized_callback(_async_initialized_callback)
|
||||
|
||||
def _volume(call):
|
||||
def _volume(call: ServiceCall) -> None:
|
||||
"""Increase/decrease volume and mute/unmute system."""
|
||||
mute_key_mapping = {
|
||||
ATTR_TOGGLE: KEY_MUTE_TOGGLE,
|
||||
@ -264,7 +264,7 @@ def setup(hass: HomeAssistant, base_config: ConfigType) -> bool: # noqa: C901
|
||||
hdmi_network.send_command(KeyPressCommand(cmd, dst=ADDR_AUDIOSYSTEM))
|
||||
hdmi_network.send_command(KeyReleaseCommand(dst=ADDR_AUDIOSYSTEM))
|
||||
|
||||
def _tx(call):
|
||||
def _tx(call: ServiceCall) -> None:
|
||||
"""Send CEC command."""
|
||||
data = call.data
|
||||
if ATTR_RAW in data:
|
||||
@ -282,7 +282,7 @@ def setup(hass: HomeAssistant, base_config: ConfigType) -> bool: # noqa: C901
|
||||
cmd = data[ATTR_CMD]
|
||||
else:
|
||||
_LOGGER.error("Attribute 'cmd' is missing")
|
||||
return False
|
||||
return
|
||||
if ATTR_ATT in data:
|
||||
if isinstance(data[ATTR_ATT], (list,)):
|
||||
att = data[ATTR_ATT]
|
||||
@ -293,13 +293,13 @@ def setup(hass: HomeAssistant, base_config: ConfigType) -> bool: # noqa: C901
|
||||
command = CecCommand(cmd, dst, src, att)
|
||||
hdmi_network.send_command(command)
|
||||
|
||||
def _standby(call):
|
||||
def _standby(call: ServiceCall) -> None:
|
||||
hdmi_network.standby()
|
||||
|
||||
def _power_on(call):
|
||||
def _power_on(call: ServiceCall) -> None:
|
||||
hdmi_network.power_on()
|
||||
|
||||
def _select_device(call):
|
||||
def _select_device(call: ServiceCall) -> None:
|
||||
"""Select the active device."""
|
||||
if not (addr := call.data[ATTR_DEVICE]):
|
||||
_LOGGER.error("Device not found: %s", call.data[ATTR_DEVICE])
|
||||
@ -322,7 +322,7 @@ def setup(hass: HomeAssistant, base_config: ConfigType) -> bool: # noqa: C901
|
||||
hdmi_network.active_source(addr)
|
||||
_LOGGER.info("Selected %s (%s)", call.data[ATTR_DEVICE], addr)
|
||||
|
||||
def _update(call):
|
||||
def _update(call: ServiceCall) -> None:
|
||||
"""
|
||||
Update if device update is needed.
|
||||
|
||||
|
@ -22,6 +22,7 @@ from homeassistant.const import (
|
||||
CONF_VERIFY_SSL,
|
||||
EVENT_HOMEASSISTANT_STOP,
|
||||
)
|
||||
from homeassistant.core import ServiceCall
|
||||
from homeassistant.helpers import discovery
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
@ -260,7 +261,7 @@ def setup(hass, config):
|
||||
for hub_name in conf[CONF_HOSTS]:
|
||||
entity_hubs.append(HMHub(hass, homematic, hub_name))
|
||||
|
||||
def _hm_service_virtualkey(service):
|
||||
def _hm_service_virtualkey(service: ServiceCall) -> None:
|
||||
"""Service to handle virtualkey servicecalls."""
|
||||
address = service.data.get(ATTR_ADDRESS)
|
||||
channel = service.data.get(ATTR_CHANNEL)
|
||||
@ -292,7 +293,7 @@ def setup(hass, config):
|
||||
schema=SCHEMA_SERVICE_VIRTUALKEY,
|
||||
)
|
||||
|
||||
def _service_handle_value(service):
|
||||
def _service_handle_value(service: ServiceCall) -> None:
|
||||
"""Service to call setValue method for HomeMatic system variable."""
|
||||
entity_ids = service.data.get(ATTR_ENTITY_ID)
|
||||
name = service.data[ATTR_NAME]
|
||||
@ -319,7 +320,7 @@ def setup(hass, config):
|
||||
schema=SCHEMA_SERVICE_SET_VARIABLE_VALUE,
|
||||
)
|
||||
|
||||
def _service_handle_reconnect(service):
|
||||
def _service_handle_reconnect(service: ServiceCall) -> None:
|
||||
"""Service to reconnect all HomeMatic hubs."""
|
||||
homematic.reconnect()
|
||||
|
||||
@ -330,12 +331,12 @@ def setup(hass, config):
|
||||
schema=SCHEMA_SERVICE_RECONNECT,
|
||||
)
|
||||
|
||||
def _service_handle_device(service):
|
||||
def _service_handle_device(service: ServiceCall) -> None:
|
||||
"""Service to call setValue method for HomeMatic devices."""
|
||||
address = service.data.get(ATTR_ADDRESS)
|
||||
channel = service.data.get(ATTR_CHANNEL)
|
||||
param = service.data.get(ATTR_PARAM)
|
||||
value = service.data.get(ATTR_VALUE)
|
||||
address = service.data[ATTR_ADDRESS]
|
||||
channel = service.data[ATTR_CHANNEL]
|
||||
param = service.data[ATTR_PARAM]
|
||||
value = service.data[ATTR_VALUE]
|
||||
value_type = service.data.get(ATTR_VALUE_TYPE)
|
||||
|
||||
# Convert value into correct XML-RPC Type.
|
||||
@ -368,7 +369,7 @@ def setup(hass, config):
|
||||
schema=SCHEMA_SERVICE_SET_DEVICE_VALUE,
|
||||
)
|
||||
|
||||
def _service_handle_install_mode(service):
|
||||
def _service_handle_install_mode(service: ServiceCall) -> None:
|
||||
"""Service to set interface into install mode."""
|
||||
interface = service.data.get(ATTR_INTERFACE)
|
||||
mode = service.data.get(ATTR_MODE)
|
||||
@ -384,15 +385,15 @@ def setup(hass, config):
|
||||
schema=SCHEMA_SERVICE_SET_INSTALL_MODE,
|
||||
)
|
||||
|
||||
def _service_put_paramset(service):
|
||||
def _service_put_paramset(service: ServiceCall) -> None:
|
||||
"""Service to call the putParamset method on a HomeMatic connection."""
|
||||
interface = service.data.get(ATTR_INTERFACE)
|
||||
address = service.data.get(ATTR_ADDRESS)
|
||||
paramset_key = service.data.get(ATTR_PARAMSET_KEY)
|
||||
interface = service.data[ATTR_INTERFACE]
|
||||
address = service.data[ATTR_ADDRESS]
|
||||
paramset_key = service.data[ATTR_PARAMSET_KEY]
|
||||
# When passing in the paramset from a YAML file we get an OrderedDict
|
||||
# here instead of a dict, so add this explicit cast.
|
||||
# The service schema makes sure that this cast works.
|
||||
paramset = dict(service.data.get(ATTR_PARAMSET))
|
||||
paramset = dict(service.data[ATTR_PARAMSET])
|
||||
rx_mode = service.data.get(ATTR_RX_MODE)
|
||||
|
||||
_LOGGER.debug(
|
||||
|
@ -26,6 +26,7 @@ from homeassistant.const import (
|
||||
STATE_ALARM_ARMED_NIGHT,
|
||||
STATE_ALARM_DISARMED,
|
||||
)
|
||||
from homeassistant.core import ServiceCall
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import ATTR_EVENT, DOMAIN, SERVICE_PUSH_ALARM_STATE, SERVICE_TRIGGER
|
||||
@ -99,7 +100,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
hass.data[DATA_IFTTT_ALARM].append(alarmpanel)
|
||||
add_entities([alarmpanel])
|
||||
|
||||
async def push_state_update(service):
|
||||
async def push_state_update(service: ServiceCall) -> None:
|
||||
"""Set the service state as device state attribute."""
|
||||
entity_ids = service.data.get(ATTR_ENTITY_ID)
|
||||
state = service.data.get(ATTR_STATE)
|
||||
|
@ -19,7 +19,7 @@ from homeassistant.const import (
|
||||
TEMP_CELSIUS,
|
||||
Platform,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.core import HomeAssistant, ServiceCall
|
||||
from homeassistant.helpers import discovery
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
@ -354,28 +354,28 @@ def setup_service_functions(hass: HomeAssistant):
|
||||
ihc_key = f"ihc{controller_id}"
|
||||
return hass.data[ihc_key][IHC_CONTROLLER]
|
||||
|
||||
def set_runtime_value_bool(call):
|
||||
def set_runtime_value_bool(call: ServiceCall) -> None:
|
||||
"""Set a IHC runtime bool value service function."""
|
||||
ihc_id = call.data[ATTR_IHC_ID]
|
||||
value = call.data[ATTR_VALUE]
|
||||
ihc_controller = _get_controller(call)
|
||||
ihc_controller.set_runtime_value_bool(ihc_id, value)
|
||||
|
||||
def set_runtime_value_int(call):
|
||||
def set_runtime_value_int(call: ServiceCall) -> None:
|
||||
"""Set a IHC runtime integer value service function."""
|
||||
ihc_id = call.data[ATTR_IHC_ID]
|
||||
value = call.data[ATTR_VALUE]
|
||||
ihc_controller = _get_controller(call)
|
||||
ihc_controller.set_runtime_value_int(ihc_id, value)
|
||||
|
||||
def set_runtime_value_float(call):
|
||||
def set_runtime_value_float(call: ServiceCall) -> None:
|
||||
"""Set a IHC runtime float value service function."""
|
||||
ihc_id = call.data[ATTR_IHC_ID]
|
||||
value = call.data[ATTR_VALUE]
|
||||
ihc_controller = _get_controller(call)
|
||||
ihc_controller.set_runtime_value_float(ihc_id, value)
|
||||
|
||||
async def async_pulse_runtime_input(call):
|
||||
async def async_pulse_runtime_input(call: ServiceCall) -> None:
|
||||
"""Pulse a IHC controller input function."""
|
||||
ihc_id = call.data[ATTR_IHC_ID]
|
||||
ihc_controller = _get_controller(call)
|
||||
|
@ -13,6 +13,7 @@ from pyjoin import (
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_API_KEY, CONF_DEVICE_ID, CONF_NAME
|
||||
from homeassistant.core import ServiceCall
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@ -44,7 +45,7 @@ CONFIG_SCHEMA = vol.Schema(
|
||||
def register_device(hass, api_key, name, device_id, device_ids, device_names):
|
||||
"""Register services for each join device listed."""
|
||||
|
||||
def ring_service(service):
|
||||
def ring_service(service: ServiceCall) -> None:
|
||||
"""Service to ring devices."""
|
||||
ring_device(
|
||||
api_key=api_key,
|
||||
@ -53,7 +54,7 @@ def register_device(hass, api_key, name, device_id, device_ids, device_names):
|
||||
device_names=device_names,
|
||||
)
|
||||
|
||||
def set_wallpaper_service(service):
|
||||
def set_wallpaper_service(service: ServiceCall) -> None:
|
||||
"""Service to set wallpaper on devices."""
|
||||
set_wallpaper(
|
||||
api_key=api_key,
|
||||
@ -63,7 +64,7 @@ def register_device(hass, api_key, name, device_id, device_ids, device_names):
|
||||
url=service.data.get("url"),
|
||||
)
|
||||
|
||||
def send_file_service(service):
|
||||
def send_file_service(service: ServiceCall) -> None:
|
||||
"""Service to send files to devices."""
|
||||
send_file(
|
||||
api_key=api_key,
|
||||
@ -73,7 +74,7 @@ def register_device(hass, api_key, name, device_id, device_ids, device_names):
|
||||
url=service.data.get("url"),
|
||||
)
|
||||
|
||||
def send_url_service(service):
|
||||
def send_url_service(service: ServiceCall) -> None:
|
||||
"""Service to open url on devices."""
|
||||
send_url(
|
||||
api_key=api_key,
|
||||
@ -83,7 +84,7 @@ def register_device(hass, api_key, name, device_id, device_ids, device_names):
|
||||
url=service.data.get("url"),
|
||||
)
|
||||
|
||||
def send_tasker_service(service):
|
||||
def send_tasker_service(service: ServiceCall) -> None:
|
||||
"""Service to open url on devices."""
|
||||
send_notification(
|
||||
api_key=api_key,
|
||||
@ -93,7 +94,7 @@ def register_device(hass, api_key, name, device_id, device_ids, device_names):
|
||||
text=service.data.get("command"),
|
||||
)
|
||||
|
||||
def send_sms_service(service):
|
||||
def send_sms_service(service: ServiceCall) -> None:
|
||||
"""Service to send sms from devices."""
|
||||
send_sms(
|
||||
device_id=device_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user