diff --git a/homeassistant/components/izone/climate.py b/homeassistant/components/izone/climate.py index 419e1709b45..a26490e78c8 100644 --- a/homeassistant/components/izone/climate.py +++ b/homeassistant/components/izone/climate.py @@ -76,7 +76,7 @@ async def async_setup_entry( @callback def init_controller(ctrl: Controller): """Register the controller device and the containing zones.""" - conf: ConfigType = hass.data.get(DATA_CONFIG) + conf: ConfigType | None = hass.data.get(DATA_CONFIG) # Filter out any entities excluded in the config file if conf and ctrl.device_uid in conf[CONF_EXCLUDE]: @@ -107,8 +107,6 @@ async def async_setup_entry( "async_set_airflow_max", ) - return True - def _return_on_connection_error(ret=None): def wrap(func): @@ -310,7 +308,7 @@ class ControllerDevice(ClimateEntity): return key assert False, "Should be unreachable" - @property + @property # type: ignore[misc] @_return_on_connection_error([]) def hvac_modes(self) -> list[HVACMode]: """Return the list of available operation modes.""" @@ -318,13 +316,13 @@ class ControllerDevice(ClimateEntity): return [HVACMode.OFF, HVACMode.FAN_ONLY] return [HVACMode.OFF, *self._state_to_pizone] - @property + @property # type: ignore[misc] @_return_on_connection_error(PRESET_NONE) def preset_mode(self): """Eco mode is external air.""" return PRESET_ECO if self._controller.free_air else PRESET_NONE - @property + @property # type: ignore[misc] @_return_on_connection_error([PRESET_NONE]) def preset_modes(self): """Available preset modes, normal or eco.""" @@ -332,7 +330,7 @@ class ControllerDevice(ClimateEntity): return [PRESET_NONE, PRESET_ECO] return [PRESET_NONE] - @property + @property # type: ignore[misc] @_return_on_connection_error() def current_temperature(self) -> float | None: """Return the current temperature.""" @@ -362,7 +360,7 @@ class ControllerDevice(ClimateEntity): return None return zone.target_temperature - @property + @property # type: ignore[misc] @_return_on_connection_error() def target_temperature(self) -> float | None: """Return the temperature we try to reach (either from control zone or master unit).""" @@ -390,13 +388,13 @@ class ControllerDevice(ClimateEntity): """Return the list of available fan modes.""" return list(self._fan_to_pizone) - @property + @property # type: ignore[misc] @_return_on_connection_error(0.0) def min_temp(self) -> float: """Return the minimum temperature.""" return self._controller.temp_min - @property + @property # type: ignore[misc] @_return_on_connection_error(50.0) def max_temp(self) -> float: """Return the maximum temperature.""" @@ -471,7 +469,9 @@ class ZoneDevice(ClimateEntity): self._attr_supported_features |= ClimateEntityFeature.TARGET_TEMPERATURE self._attr_device_info = DeviceInfo( - identifiers={(IZONE, controller.unique_id, zone.index)}, + identifiers={ + (IZONE, controller.unique_id, zone.index) # type:ignore[arg-type] + }, manufacturer="IZone", model=zone.type.name.title(), name=self.name, @@ -533,7 +533,7 @@ class ZoneDevice(ClimateEntity): """ return False - @property + @property # type: ignore[misc] @_return_on_connection_error(0) def supported_features(self): """Return the list of supported features.""" @@ -552,7 +552,7 @@ class ZoneDevice(ClimateEntity): return PRECISION_TENTHS @property - def hvac_mode(self) -> HVACMode: + def hvac_mode(self) -> HVACMode | None: """Return current operation ie. heat, cool, idle.""" mode = self._zone.mode for (key, value) in self._state_to_pizone.items(): diff --git a/mypy.ini b/mypy.ini index ca7fd4a15c2..ce02b366ad0 100644 --- a/mypy.ini +++ b/mypy.ini @@ -2687,9 +2687,6 @@ ignore_errors = true [mypy-homeassistant.components.icloud.sensor] ignore_errors = true -[mypy-homeassistant.components.izone.climate] -ignore_errors = true - [mypy-homeassistant.components.lovelace] ignore_errors = true diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index 21309560eb3..8d36184290b 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -30,7 +30,6 @@ IGNORED_MODULES: Final[list[str]] = [ "homeassistant.components.icloud.account", "homeassistant.components.icloud.device_tracker", "homeassistant.components.icloud.sensor", - "homeassistant.components.izone.climate", "homeassistant.components.lovelace", "homeassistant.components.lovelace.dashboard", "homeassistant.components.lovelace.resources",