1
mirror of https://github.com/home-assistant/core synced 2024-09-06 10:29:55 +02:00

Enable basic type checking for Tasmota (#52435)

This commit is contained in:
Erik Montnemery 2021-07-02 16:45:38 +02:00 committed by GitHub
parent ed25e6fada
commit 98fdb00bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 9 deletions

View File

@ -81,9 +81,9 @@ class Trigger:
"""Device trigger settings."""
device_id: str = attr.ib()
discovery_hash: dict = attr.ib()
discovery_hash: dict | None = attr.ib()
hass: HomeAssistant = attr.ib()
remove_update_signal: Callable[[], None] = attr.ib()
remove_update_signal: Callable[[], None] | None = attr.ib()
subtype: str = attr.ib()
tasmota_trigger: TasmotaTrigger = attr.ib()
type: str = attr.ib()
@ -242,7 +242,7 @@ async def async_remove_triggers(hass: HomeAssistant, device_id: str):
async def async_get_triggers(hass: HomeAssistant, device_id: str) -> list[dict]:
"""List device triggers for a Tasmota device."""
triggers = []
triggers: list[dict[str, str]] = []
if DEVICE_TRIGGERS not in hass.data:
return triggers

View File

@ -42,7 +42,7 @@ def set_discovery_hash(hass, discovery_hash):
async def async_start(
hass: HomeAssistant, discovery_topic, config_entry, tasmota_mqtt, setup_device
) -> bool:
) -> None:
"""Start Tasmota device discovery."""
async def _discover_entity(tasmota_entity_config, discovery_hash, platform):
@ -171,7 +171,7 @@ async def async_start(
hass.data[TASMOTA_DISCOVERY_INSTANCE] = tasmota_discovery
async def async_stop(hass: HomeAssistant) -> bool:
async def async_stop(hass: HomeAssistant) -> None:
"""Stop Tasmota device discovery."""
hass.data.pop(ALREADY_DISCOVERED)
tasmota_discovery = hass.data.pop(TASMOTA_DISCOVERY_INSTANCE)

View File

@ -1534,9 +1534,6 @@ ignore_errors = true
[mypy-homeassistant.components.tado.*]
ignore_errors = true
[mypy-homeassistant.components.tasmota.*]
ignore_errors = true
[mypy-homeassistant.components.telegram_bot.*]
ignore_errors = true

View File

@ -199,7 +199,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.system_health.*",
"homeassistant.components.system_log.*",
"homeassistant.components.tado.*",
"homeassistant.components.tasmota.*",
"homeassistant.components.telegram_bot.*",
"homeassistant.components.template.*",
"homeassistant.components.tesla.*",