Ensure Ambient PWS is strictly typed (#53251)
* Ensure Ambient PWS is strictly typed * Fix typingpull/53242/head
parent
9d3bc0632f
commit
56efee4603
|
@ -13,6 +13,7 @@ homeassistant.components.aladdin_connect.*
|
|||
homeassistant.components.alarm_control_panel.*
|
||||
homeassistant.components.amazon_polly.*
|
||||
homeassistant.components.ambee.*
|
||||
homeassistant.components.ambient_station.*
|
||||
homeassistant.components.ampio.*
|
||||
homeassistant.components.automation.*
|
||||
homeassistant.components.binary_sensor.*
|
||||
|
|
|
@ -32,7 +32,7 @@ from homeassistant.const import (
|
|||
SPEED_MILES_PER_HOUR,
|
||||
TEMP_FAHRENHEIT,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.core import Event, HomeAssistant, callback
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.helpers import aiohttp_client, config_validation as cv
|
||||
from homeassistant.helpers.dispatcher import (
|
||||
|
@ -320,7 +320,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||
LOGGER.error("Config entry failed: %s", err)
|
||||
raise ConfigEntryNotReady from err
|
||||
|
||||
async def _async_disconnect_websocket(*_):
|
||||
async def _async_disconnect_websocket(_: Event) -> None:
|
||||
await ambient.client.websocket.disconnect()
|
||||
|
||||
config_entry.async_on_unload(
|
||||
|
@ -378,7 +378,7 @@ class AmbientStation:
|
|||
async def _attempt_connect(self) -> None:
|
||||
"""Attempt to connect to the socket (retrying later on fail)."""
|
||||
|
||||
async def connect(timestamp: int | None = None):
|
||||
async def connect(timestamp: int | None = None) -> None:
|
||||
"""Connect."""
|
||||
await self.client.websocket.connect()
|
||||
|
||||
|
|
11
mypy.ini
11
mypy.ini
|
@ -154,6 +154,17 @@ no_implicit_optional = true
|
|||
warn_return_any = true
|
||||
warn_unreachable = true
|
||||
|
||||
[mypy-homeassistant.components.ambient_station.*]
|
||||
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.ampio.*]
|
||||
check_untyped_defs = true
|
||||
disallow_incomplete_defs = true
|
||||
|
|
Loading…
Reference in New Issue