mirror of https://github.com/home-assistant/core
Enable strict typing of hardware (#83120)
* Enable strict typing of hardware * Address review comment
This commit is contained in:
parent
ee7022dc67
commit
7e2960a973
|
@ -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.*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"]
|
||||
|
|
10
mypy.ini
10
mypy.ini
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue