mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add strict typing to adguard (#67775)
This commit is contained in:
parent
68f932f6c3
commit
6a92081e83
@ -32,6 +32,7 @@ homeassistant.components.abode.*
|
|||||||
homeassistant.components.acer_projector.*
|
homeassistant.components.acer_projector.*
|
||||||
homeassistant.components.accuweather.*
|
homeassistant.components.accuweather.*
|
||||||
homeassistant.components.actiontec.*
|
homeassistant.components.actiontec.*
|
||||||
|
homeassistant.components.adguard.*
|
||||||
homeassistant.components.aftership.*
|
homeassistant.components.aftership.*
|
||||||
homeassistant.components.air_quality.*
|
homeassistant.components.air_quality.*
|
||||||
homeassistant.components.airly.*
|
homeassistant.components.airly.*
|
||||||
|
@ -27,7 +27,7 @@ class AdGuardHomeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
_hassio_discovery = None
|
_hassio_discovery: dict[str, Any] | None = None
|
||||||
|
|
||||||
async def _show_setup_form(
|
async def _show_setup_form(
|
||||||
self, errors: dict[str, str] | None = None
|
self, errors: dict[str, str] | None = None
|
||||||
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from adguardhome import AdGuardHome, AdGuardHomeConnectionError, AdGuardHomeError
|
from adguardhome import AdGuardHome, AdGuardHomeConnectionError, AdGuardHomeError
|
||||||
|
|
||||||
@ -76,7 +77,7 @@ class AdGuardHomeSwitch(AdGuardHomeDeviceEntity, SwitchEntity):
|
|||||||
"""Return the state of the switch."""
|
"""Return the state of the switch."""
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
async def async_turn_off(self, **kwargs) -> None:
|
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||||
"""Turn off the switch."""
|
"""Turn off the switch."""
|
||||||
try:
|
try:
|
||||||
await self._adguard_turn_off()
|
await self._adguard_turn_off()
|
||||||
@ -88,7 +89,7 @@ class AdGuardHomeSwitch(AdGuardHomeDeviceEntity, SwitchEntity):
|
|||||||
"""Turn off the switch."""
|
"""Turn off the switch."""
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
async def async_turn_on(self, **kwargs) -> None:
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
"""Turn on the switch."""
|
"""Turn on the switch."""
|
||||||
try:
|
try:
|
||||||
await self._adguard_turn_on()
|
await self._adguard_turn_on()
|
||||||
|
11
mypy.ini
11
mypy.ini
@ -153,6 +153,17 @@ no_implicit_optional = true
|
|||||||
warn_return_any = true
|
warn_return_any = true
|
||||||
warn_unreachable = true
|
warn_unreachable = true
|
||||||
|
|
||||||
|
[mypy-homeassistant.components.adguard.*]
|
||||||
|
check_untyped_defs = true
|
||||||
|
disallow_incomplete_defs = true
|
||||||
|
disallow_subclassing_any = true
|
||||||
|
disallow_untyped_calls = true
|
||||||
|
disallow_untyped_decorators = true
|
||||||
|
disallow_untyped_defs = true
|
||||||
|
no_implicit_optional = true
|
||||||
|
warn_return_any = true
|
||||||
|
warn_unreachable = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.aftership.*]
|
[mypy-homeassistant.components.aftership.*]
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
disallow_incomplete_defs = true
|
disallow_incomplete_defs = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user