mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Enable basic type checking for Tasmota (#52435)
This commit is contained in:
parent
ed25e6fada
commit
98fdb00bc7
@ -81,9 +81,9 @@ class Trigger:
|
|||||||
"""Device trigger settings."""
|
"""Device trigger settings."""
|
||||||
|
|
||||||
device_id: str = attr.ib()
|
device_id: str = attr.ib()
|
||||||
discovery_hash: dict = attr.ib()
|
discovery_hash: dict | None = attr.ib()
|
||||||
hass: HomeAssistant = 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()
|
subtype: str = attr.ib()
|
||||||
tasmota_trigger: TasmotaTrigger = attr.ib()
|
tasmota_trigger: TasmotaTrigger = attr.ib()
|
||||||
type: str = 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]:
|
async def async_get_triggers(hass: HomeAssistant, device_id: str) -> list[dict]:
|
||||||
"""List device triggers for a Tasmota device."""
|
"""List device triggers for a Tasmota device."""
|
||||||
triggers = []
|
triggers: list[dict[str, str]] = []
|
||||||
|
|
||||||
if DEVICE_TRIGGERS not in hass.data:
|
if DEVICE_TRIGGERS not in hass.data:
|
||||||
return triggers
|
return triggers
|
||||||
|
@ -42,7 +42,7 @@ def set_discovery_hash(hass, discovery_hash):
|
|||||||
|
|
||||||
async def async_start(
|
async def async_start(
|
||||||
hass: HomeAssistant, discovery_topic, config_entry, tasmota_mqtt, setup_device
|
hass: HomeAssistant, discovery_topic, config_entry, tasmota_mqtt, setup_device
|
||||||
) -> bool:
|
) -> None:
|
||||||
"""Start Tasmota device discovery."""
|
"""Start Tasmota device discovery."""
|
||||||
|
|
||||||
async def _discover_entity(tasmota_entity_config, discovery_hash, platform):
|
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
|
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."""
|
"""Stop Tasmota device discovery."""
|
||||||
hass.data.pop(ALREADY_DISCOVERED)
|
hass.data.pop(ALREADY_DISCOVERED)
|
||||||
tasmota_discovery = hass.data.pop(TASMOTA_DISCOVERY_INSTANCE)
|
tasmota_discovery = hass.data.pop(TASMOTA_DISCOVERY_INSTANCE)
|
||||||
|
3
mypy.ini
3
mypy.ini
@ -1534,9 +1534,6 @@ ignore_errors = true
|
|||||||
[mypy-homeassistant.components.tado.*]
|
[mypy-homeassistant.components.tado.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.tasmota.*]
|
|
||||||
ignore_errors = true
|
|
||||||
|
|
||||||
[mypy-homeassistant.components.telegram_bot.*]
|
[mypy-homeassistant.components.telegram_bot.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
|
@ -199,7 +199,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
|||||||
"homeassistant.components.system_health.*",
|
"homeassistant.components.system_health.*",
|
||||||
"homeassistant.components.system_log.*",
|
"homeassistant.components.system_log.*",
|
||||||
"homeassistant.components.tado.*",
|
"homeassistant.components.tado.*",
|
||||||
"homeassistant.components.tasmota.*",
|
|
||||||
"homeassistant.components.telegram_bot.*",
|
"homeassistant.components.telegram_bot.*",
|
||||||
"homeassistant.components.template.*",
|
"homeassistant.components.template.*",
|
||||||
"homeassistant.components.tesla.*",
|
"homeassistant.components.tesla.*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user