Activate mypy for wink (#55077)

This commit is contained in:
jan iversen 2021-08-23 22:55:00 +02:00 committed by GitHub
parent cada3d1819
commit 9b472aee9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 8 deletions

View File

@ -1,9 +1,12 @@
"""Support for Wink hubs.""" """Support for Wink hubs."""
from __future__ import annotations
from datetime import timedelta from datetime import timedelta
import json import json
import logging import logging
import os import os
import time import time
from typing import Any
from aiohttp.web import Response from aiohttp.web import Response
from pubnubsubhandler import PubNubSubscriptionHandler from pubnubsubhandler import PubNubSubscriptionHandler
@ -208,7 +211,7 @@ WINK_COMPONENTS = [
"water_heater", "water_heater",
] ]
WINK_HUBS = [] WINK_HUBS: list[Any] = []
def _request_app_setup(hass, config): def _request_app_setup(hass, config):

View File

@ -234,7 +234,7 @@ class WinkThermostat(WinkDevice, ClimateEntity):
return HVAC_MODE_HEAT return HVAC_MODE_HEAT
if wink_mode == "eco": if wink_mode == "eco":
return HVAC_MODE_AUTO return HVAC_MODE_AUTO
return WINK_HVAC_TO_HA.get(wink_mode) return WINK_HVAC_TO_HA.get(wink_mode, "")
@property @property
def hvac_modes(self): def hvac_modes(self):
@ -437,7 +437,7 @@ class WinkAC(WinkDevice, ClimateEntity):
wink_mode = self.wink.current_mode() wink_mode = self.wink.current_mode()
if wink_mode == "auto_eco": if wink_mode == "auto_eco":
return HVAC_MODE_COOL return HVAC_MODE_COOL
return WINK_HVAC_TO_HA.get(wink_mode) return WINK_HVAC_TO_HA.get(wink_mode, "")
@property @property
def hvac_modes(self): def hvac_modes(self):

View File

@ -1,4 +1,6 @@
"""Support for Wink fans.""" """Support for Wink fans."""
from __future__ import annotations
import pywink import pywink
from homeassistant.components.fan import ( from homeassistant.components.fan import (
@ -67,7 +69,7 @@ class WinkFanDevice(WinkDevice, FanEntity):
return self.wink.state() return self.wink.state()
@property @property
def speed(self) -> str: def speed(self) -> str | None:
"""Return the current speed.""" """Return the current speed."""
current_wink_speed = self.wink.current_fan_speed() current_wink_speed = self.wink.current_fan_speed()
if SPEED_AUTO == current_wink_speed: if SPEED_AUTO == current_wink_speed:

View File

@ -1655,9 +1655,6 @@ ignore_errors = true
[mypy-homeassistant.components.wemo.*] [mypy-homeassistant.components.wemo.*]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.wink.*]
ignore_errors = true
[mypy-homeassistant.components.withings.*] [mypy-homeassistant.components.withings.*]
ignore_errors = true ignore_errors = true

View File

@ -144,7 +144,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.verisure.*", "homeassistant.components.verisure.*",
"homeassistant.components.vizio.*", "homeassistant.components.vizio.*",
"homeassistant.components.wemo.*", "homeassistant.components.wemo.*",
"homeassistant.components.wink.*",
"homeassistant.components.withings.*", "homeassistant.components.withings.*",
"homeassistant.components.xbox.*", "homeassistant.components.xbox.*",
"homeassistant.components.xiaomi_aqara.*", "homeassistant.components.xiaomi_aqara.*",