mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Ensure Ambient PWS is strictly typed (#53251)
* Ensure Ambient PWS is strictly typed * Fix typing
This commit is contained in:
parent
9d3bc0632f
commit
56efee4603
@ -13,6 +13,7 @@ homeassistant.components.aladdin_connect.*
|
|||||||
homeassistant.components.alarm_control_panel.*
|
homeassistant.components.alarm_control_panel.*
|
||||||
homeassistant.components.amazon_polly.*
|
homeassistant.components.amazon_polly.*
|
||||||
homeassistant.components.ambee.*
|
homeassistant.components.ambee.*
|
||||||
|
homeassistant.components.ambient_station.*
|
||||||
homeassistant.components.ampio.*
|
homeassistant.components.ampio.*
|
||||||
homeassistant.components.automation.*
|
homeassistant.components.automation.*
|
||||||
homeassistant.components.binary_sensor.*
|
homeassistant.components.binary_sensor.*
|
||||||
|
@ -32,7 +32,7 @@ from homeassistant.const import (
|
|||||||
SPEED_MILES_PER_HOUR,
|
SPEED_MILES_PER_HOUR,
|
||||||
TEMP_FAHRENHEIT,
|
TEMP_FAHRENHEIT,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import Event, HomeAssistant, callback
|
||||||
from homeassistant.exceptions import ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
from homeassistant.helpers import aiohttp_client, config_validation as cv
|
from homeassistant.helpers import aiohttp_client, config_validation as cv
|
||||||
from homeassistant.helpers.dispatcher import (
|
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)
|
LOGGER.error("Config entry failed: %s", err)
|
||||||
raise ConfigEntryNotReady from err
|
raise ConfigEntryNotReady from err
|
||||||
|
|
||||||
async def _async_disconnect_websocket(*_):
|
async def _async_disconnect_websocket(_: Event) -> None:
|
||||||
await ambient.client.websocket.disconnect()
|
await ambient.client.websocket.disconnect()
|
||||||
|
|
||||||
config_entry.async_on_unload(
|
config_entry.async_on_unload(
|
||||||
@ -378,7 +378,7 @@ class AmbientStation:
|
|||||||
async def _attempt_connect(self) -> None:
|
async def _attempt_connect(self) -> None:
|
||||||
"""Attempt to connect to the socket (retrying later on fail)."""
|
"""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."""
|
"""Connect."""
|
||||||
await self.client.websocket.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_return_any = true
|
||||||
warn_unreachable = 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.*]
|
[mypy-homeassistant.components.ampio.*]
|
||||||
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