Enable strict typing of hardware (#83120)

* Enable strict typing of hardware

* Address review comment
This commit is contained in:
Erik Montnemery 2022-12-05 09:32:52 +01:00 committed by GitHub
parent ee7022dc67
commit 7e2960a973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 5 deletions

View File

@ -129,6 +129,7 @@ homeassistant.components.greeneye_monitor.*
homeassistant.components.group.*
homeassistant.components.guardian.*
homeassistant.components.hardkernel.*
homeassistant.components.hardware.*
homeassistant.components.history.*
homeassistant.components.homeassistant.triggers.event
homeassistant.components.homeassistant_alerts.*

View File

@ -11,18 +11,16 @@ from .const import DOMAIN
from .models import HardwareProtocol
async def async_process_hardware_platforms(hass: HomeAssistant):
async def async_process_hardware_platforms(hass: HomeAssistant) -> None:
"""Start processing hardware platforms."""
hass.data[DOMAIN]["hardware_platform"] = {}
await async_process_integration_platforms(hass, DOMAIN, _register_hardware_platform)
return True
async def _register_hardware_platform(
hass: HomeAssistant, integration_domain: str, platform: HardwareProtocol
):
) -> None:
"""Register a hardware platform."""
if integration_domain == DOMAIN:
return

View File

@ -74,7 +74,7 @@ async def ws_info(
@websocket_api.async_response
async def ws_subscribe_system_status(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
):
) -> None:
"""Subscribe to system status updates."""
system_status: SystemStatus = hass.data[DOMAIN]["system_status"]

View File

@ -1044,6 +1044,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.hardware.*]
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.history.*]
check_untyped_defs = true
disallow_incomplete_defs = true