Remove gree from mypy ignore list (#74411)

This commit is contained in:
epenet 2022-07-04 16:47:35 +02:00 committed by GitHub
parent 035e96a79b
commit e3bd63934b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 12 deletions

View File

@ -198,14 +198,14 @@ class GreeClimateEntity(CoordinatorEntity, ClimateEntity):
return TARGET_TEMPERATURE_STEP return TARGET_TEMPERATURE_STEP
@property @property
def hvac_mode(self) -> str: def hvac_mode(self) -> HVACMode | None:
"""Return the current HVAC mode for the device.""" """Return the current HVAC mode for the device."""
if not self.coordinator.device.power: if not self.coordinator.device.power:
return HVACMode.OFF return HVACMode.OFF
return HVAC_MODES.get(self.coordinator.device.mode) 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.""" """Set new target hvac mode."""
if hvac_mode not in self.hvac_modes: if hvac_mode not in self.hvac_modes:
raise ValueError(f"Invalid hvac_mode: {hvac_mode}") raise ValueError(f"Invalid hvac_mode: {hvac_mode}")
@ -246,7 +246,7 @@ class GreeClimateEntity(CoordinatorEntity, ClimateEntity):
self.async_write_ha_state() self.async_write_ha_state()
@property @property
def hvac_modes(self) -> list[str]: def hvac_modes(self) -> list[HVACMode]:
"""Return the HVAC modes support by the device.""" """Return the HVAC modes support by the device."""
modes = [*HVAC_MODES_REVERSE] modes = [*HVAC_MODES_REVERSE]
modes.append(HVACMode.OFF) modes.append(HVACMode.OFF)
@ -299,7 +299,7 @@ class GreeClimateEntity(CoordinatorEntity, ClimateEntity):
return PRESET_MODES return PRESET_MODES
@property @property
def fan_mode(self) -> str: def fan_mode(self) -> str | None:
"""Return the current fan mode for the device.""" """Return the current fan mode for the device."""
speed = self.coordinator.device.fan_speed speed = self.coordinator.device.fan_speed
return FAN_MODES.get(speed) return FAN_MODES.get(speed)

View File

@ -2663,12 +2663,6 @@ ignore_errors = true
[mypy-homeassistant.components.google_assistant.trait] [mypy-homeassistant.components.google_assistant.trait]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.gree.climate]
ignore_errors = true
[mypy-homeassistant.components.gree.switch]
ignore_errors = true
[mypy-homeassistant.components.harmony] [mypy-homeassistant.components.harmony]
ignore_errors = true ignore_errors = true

View File

@ -33,8 +33,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.google_assistant.http", "homeassistant.components.google_assistant.http",
"homeassistant.components.google_assistant.report_state", "homeassistant.components.google_assistant.report_state",
"homeassistant.components.google_assistant.trait", "homeassistant.components.google_assistant.trait",
"homeassistant.components.gree.climate",
"homeassistant.components.gree.switch",
"homeassistant.components.harmony", "homeassistant.components.harmony",
"homeassistant.components.harmony.config_flow", "homeassistant.components.harmony.config_flow",
"homeassistant.components.harmony.data", "homeassistant.components.harmony.data",