diff --git a/.strict-typing b/.strict-typing index f7a02feec67..1163dea618c 100644 --- a/.strict-typing +++ b/.strict-typing @@ -339,6 +339,7 @@ homeassistant.components.remote.* homeassistant.components.renault.* homeassistant.components.repairs.* homeassistant.components.rest.* +homeassistant.components.rest_command.* homeassistant.components.rfxtrx.* homeassistant.components.rhasspy.* homeassistant.components.ridwell.* diff --git a/homeassistant/components/rest_command/__init__.py b/homeassistant/components/rest_command/__init__.py index 7d566933b5f..0c055fe0000 100644 --- a/homeassistant/components/rest_command/__init__.py +++ b/homeassistant/components/rest_command/__init__.py @@ -1,8 +1,11 @@ """Support for exposing regular REST commands as services.""" +from __future__ import annotations + import asyncio from http import HTTPStatus from json.decoder import JSONDecodeError import logging +from typing import Any import aiohttp from aiohttp import hdrs @@ -86,9 +89,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: async_register_rest_command(name, command_config) @callback - def async_register_rest_command(name, command_config): + def async_register_rest_command(name: str, command_config: dict[str, Any]) -> None: """Create service for rest command.""" - websession = async_get_clientsession(hass, command_config.get(CONF_VERIFY_SSL)) + websession = async_get_clientsession(hass, command_config[CONF_VERIFY_SSL]) timeout = command_config[CONF_TIMEOUT] method = command_config[CONF_METHOD] diff --git a/mypy.ini b/mypy.ini index f3be41c3036..d049a922e1b 100644 --- a/mypy.ini +++ b/mypy.ini @@ -3151,6 +3151,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.rest_command.*] +check_untyped_defs = true +disallow_incomplete_defs = true +disallow_subclassing_any = true +disallow_untyped_calls = true +disallow_untyped_decorators = true +disallow_untyped_defs = true +warn_return_any = true +warn_unreachable = true + [mypy-homeassistant.components.rfxtrx.*] check_untyped_defs = true disallow_incomplete_defs = true