Activate mypy for Trådfri (#54416)

* Activate mypy.
pull/54452/head
jan iversen 2021-08-11 08:31:52 +02:00 committed by GitHub
parent 10551743d6
commit adcbd8b115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,9 @@
"""Support for IKEA Tradfri.""" """Support for IKEA Tradfri."""
from __future__ import annotations
from datetime import timedelta from datetime import timedelta
import logging import logging
from typing import Any
from pytradfri import Gateway, RequestError from pytradfri import Gateway, RequestError
from pytradfri.api.aiocoap_api import APIFactory from pytradfri.api.aiocoap_api import APIFactory
@ -70,7 +73,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType):
load_json, hass.config.path(CONFIG_FILE) load_json, hass.config.path(CONFIG_FILE)
) )
for host, info in legacy_hosts.items(): for host, info in legacy_hosts.items(): # type: ignore
if host in configured_hosts: if host in configured_hosts:
continue continue
@ -103,7 +106,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType):
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Create a gateway.""" """Create a gateway."""
# host, identity, key, allow_tradfri_groups # host, identity, key, allow_tradfri_groups
tradfri_data = hass.data.setdefault(DOMAIN, {})[entry.entry_id] = {} tradfri_data: dict[str, Any] = {}
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = tradfri_data
listeners = tradfri_data[LISTENERS] = [] listeners = tradfri_data[LISTENERS] = []
factory = await APIFactory.init( factory = await APIFactory.init(

View File

@ -1691,9 +1691,6 @@ ignore_errors = true
[mypy-homeassistant.components.tplink.*] [mypy-homeassistant.components.tplink.*]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.tradfri.*]
ignore_errors = true
[mypy-homeassistant.components.tuya.*] [mypy-homeassistant.components.tuya.*]
ignore_errors = true ignore_errors = true

View File

@ -156,7 +156,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.todoist.*", "homeassistant.components.todoist.*",
"homeassistant.components.toon.*", "homeassistant.components.toon.*",
"homeassistant.components.tplink.*", "homeassistant.components.tplink.*",
"homeassistant.components.tradfri.*",
"homeassistant.components.tuya.*", "homeassistant.components.tuya.*",
"homeassistant.components.unifi.*", "homeassistant.components.unifi.*",
"homeassistant.components.upnp.*", "homeassistant.components.upnp.*",