Ensure service calls are typed [m-z] (#63014)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet
2021-12-29 22:41:55 +01:00
committed by GitHub
parent 4ef9abbf3f
commit 709afc63b0
15 changed files with 65 additions and 53 deletions

View File

@@ -20,6 +20,7 @@ from RestrictedPython.Guards import (
import voluptuous as vol
from homeassistant.const import CONF_DESCRIPTION, CONF_NAME, SERVICE_RELOAD
from homeassistant.core import ServiceCall
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.service import async_set_service_schema
from homeassistant.loader import bind_hass
@@ -88,7 +89,7 @@ def setup(hass, config):
discover_scripts(hass)
def reload_scripts_handler(call):
def reload_scripts_handler(call: ServiceCall) -> None:
"""Handle reload service calls."""
discover_scripts(hass)
@@ -105,7 +106,7 @@ def discover_scripts(hass):
_LOGGER.warning("Folder %s not found in configuration folder", FOLDER)
return False
def python_script_service_handler(call):
def python_script_service_handler(call: ServiceCall) -> None:
"""Handle python script service calls."""
execute_script(hass, call.service, call.data)