From e3bd63934b9c31df55399cfb007d0895da464b8e Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 4 Jul 2022 16:47:35 +0200 Subject: [PATCH] Remove gree from mypy ignore list (#74411) --- homeassistant/components/gree/climate.py | 8 ++++---- mypy.ini | 6 ------ script/hassfest/mypy_config.py | 2 -- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/gree/climate.py b/homeassistant/components/gree/climate.py index 0d1c7d53f8b..2b6833dff2c 100644 --- a/homeassistant/components/gree/climate.py +++ b/homeassistant/components/gree/climate.py @@ -198,14 +198,14 @@ class GreeClimateEntity(CoordinatorEntity, ClimateEntity): return TARGET_TEMPERATURE_STEP @property - def hvac_mode(self) -> str: + def hvac_mode(self) -> HVACMode | None: """Return the current HVAC mode for the device.""" if not self.coordinator.device.power: return HVACMode.OFF return HVAC_MODES.get(self.coordinator.device.mode) - async def async_set_hvac_mode(self, hvac_mode) -> None: + async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: """Set new target hvac mode.""" if hvac_mode not in self.hvac_modes: raise ValueError(f"Invalid hvac_mode: {hvac_mode}") @@ -246,7 +246,7 @@ class GreeClimateEntity(CoordinatorEntity, ClimateEntity): self.async_write_ha_state() @property - def hvac_modes(self) -> list[str]: + def hvac_modes(self) -> list[HVACMode]: """Return the HVAC modes support by the device.""" modes = [*HVAC_MODES_REVERSE] modes.append(HVACMode.OFF) @@ -299,7 +299,7 @@ class GreeClimateEntity(CoordinatorEntity, ClimateEntity): return PRESET_MODES @property - def fan_mode(self) -> str: + def fan_mode(self) -> str | None: """Return the current fan mode for the device.""" speed = self.coordinator.device.fan_speed return FAN_MODES.get(speed) diff --git a/mypy.ini b/mypy.ini index cab794e7bfe..22a6fd801c3 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2663,12 +2663,6 @@ ignore_errors = true [mypy-homeassistant.components.google_assistant.trait] ignore_errors = true -[mypy-homeassistant.components.gree.climate] -ignore_errors = true - -[mypy-homeassistant.components.gree.switch] -ignore_errors = true - [mypy-homeassistant.components.harmony] ignore_errors = true diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index 94bb2682f3e..e9e78c2892b 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -33,8 +33,6 @@ IGNORED_MODULES: Final[list[str]] = [ "homeassistant.components.google_assistant.http", "homeassistant.components.google_assistant.report_state", "homeassistant.components.google_assistant.trait", - "homeassistant.components.gree.climate", - "homeassistant.components.gree.switch", "homeassistant.components.harmony", "homeassistant.components.harmony.config_flow", "homeassistant.components.harmony.data",