From dae40530bd4738786ef5bff96e4640574035ff64 Mon Sep 17 00:00:00 2001 From: jan iversen Date: Mon, 23 Aug 2021 22:57:33 +0200 Subject: [PATCH] Activate mypy for synology_srm (#55059) --- homeassistant/components/synology_srm/device_tracker.py | 8 +++++--- mypy.ini | 3 --- script/hassfest/mypy_config.py | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/synology_srm/device_tracker.py b/homeassistant/components/synology_srm/device_tracker.py index 55f455ad7cc..f97b1735e21 100644 --- a/homeassistant/components/synology_srm/device_tracker.py +++ b/homeassistant/components/synology_srm/device_tracker.py @@ -1,4 +1,6 @@ """Device tracker for Synology SRM routers.""" +from __future__ import annotations + import logging import synology_srm @@ -6,7 +8,7 @@ import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, - PLATFORM_SCHEMA, + PLATFORM_SCHEMA as DEVICE_TRACKER_PLATFORM_SCHEMA, DeviceScanner, ) from homeassistant.const import ( @@ -26,7 +28,7 @@ DEFAULT_PORT = 8001 DEFAULT_SSL = True DEFAULT_VERIFY_SSL = False -PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( +PLATFORM_SCHEMA = DEVICE_TRACKER_PLATFORM_SCHEMA.extend( { vol.Required(CONF_HOST): cv.string, vol.Required(CONF_USERNAME, default=DEFAULT_USERNAME): cv.string, @@ -106,7 +108,7 @@ class SynologySrmDeviceScanner(DeviceScanner): device = next( (result for result in self.devices if result["mac"] == device), None ) - filtered_attributes = {} + filtered_attributes: dict[str, str] = {} if not device: return filtered_attributes for attribute, alias in ATTRIBUTE_ALIAS.items(): diff --git a/mypy.ini b/mypy.ini index 767ecf18ea1..0db7853177e 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1607,9 +1607,6 @@ ignore_errors = true [mypy-homeassistant.components.switchbot.*] ignore_errors = true -[mypy-homeassistant.components.synology_srm.*] -ignore_errors = true - [mypy-homeassistant.components.system_health.*] ignore_errors = true diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index 799a36f92ea..b8b80ce3afd 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -128,7 +128,6 @@ IGNORED_MODULES: Final[list[str]] = [ "homeassistant.components.stt.*", "homeassistant.components.surepetcare.*", "homeassistant.components.switchbot.*", - "homeassistant.components.synology_srm.*", "homeassistant.components.system_health.*", "homeassistant.components.system_log.*", "homeassistant.components.tado.*",