diff --git a/.strict-typing b/.strict-typing index 81400b5688f..dea3fb25ffd 100644 --- a/.strict-typing +++ b/.strict-typing @@ -65,6 +65,7 @@ homeassistant.components.ampio.* homeassistant.components.analytics.* homeassistant.components.android_ip_webcam.* homeassistant.components.androidtv_remote.* +homeassistant.components.anel_pwrctrl.* homeassistant.components.anova.* homeassistant.components.anthemav.* homeassistant.components.apcupsd.* diff --git a/homeassistant/components/anel_pwrctrl/switch.py b/homeassistant/components/anel_pwrctrl/switch.py index 19d1a2deaff..827fc0037a7 100644 --- a/homeassistant/components/anel_pwrctrl/switch.py +++ b/homeassistant/components/anel_pwrctrl/switch.py @@ -5,7 +5,7 @@ from datetime import timedelta import logging from typing import Any -from anel_pwrctrl import DeviceMaster +from anel_pwrctrl import Device, DeviceMaster, Switch import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity @@ -72,7 +72,7 @@ def setup_platform( class PwrCtrlSwitch(SwitchEntity): """Representation of a PwrCtrl switch.""" - def __init__(self, port, parent_device): + def __init__(self, port: Switch, parent_device: PwrCtrlDevice) -> None: """Initialize the PwrCtrl switch.""" self._port = port self._parent_device = parent_device @@ -96,11 +96,11 @@ class PwrCtrlSwitch(SwitchEntity): class PwrCtrlDevice: """Device representation for per device throttling.""" - def __init__(self, device): + def __init__(self, device: Device) -> None: """Initialize the PwrCtrl device.""" self._device = device @Throttle(MIN_TIME_BETWEEN_UPDATES) - def update(self): + def update(self) -> None: """Update the device and all its switches.""" self._device.update() diff --git a/mypy.ini b/mypy.ini index 4b8fa484b06..71a50796866 100644 --- a/mypy.ini +++ b/mypy.ini @@ -410,6 +410,16 @@ disallow_untyped_defs = true warn_return_any = true warn_unreachable = true +[mypy-homeassistant.components.anel_pwrctrl.*] +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.anova.*] check_untyped_defs = true disallow_incomplete_defs = true