Repository: home-assistant/core
File: homeassistant/components/coolmaster/climate.py (Python)

Code before:
    @property
    def hvac_mode(self):
        """Return hvac target hvac state."""
        mode = self._unit.mode
        if not self._unit.is_on:
            return HVACMode.OFF

        return CM_TO_HA_STATE[mode]

    @property
    def fan_mode(self):
        """Return the fan setting."""

        # Normalize to lowercase for lookup, and pass unknown values through.
        fan_speed_lower = self._unit.fan_speed.lower()
        if fan_speed_lower not in CM_TO_HA_FAN:
            # TODO(2026.7.0): Stop supporting unknown fan speeds.
            ir.async_create_issue(
                self._hass,
                DOMAIN,
                "unknown_fan_speed",
                is_fixable=False,
                breaks_in_ha_version="2026.7.0",
                severity=ir.IssueSeverity.WARNING,
                translation_key="unknown_fan_speed",
                translation_placeholders={
                    "fan_speed": self._unit.fan_speed,
                    "issues_url": "https://github.com/home-assistant/core/issues",
                },
            )
            return fan_speed_lower

        return CM_TO_HA_FAN[fan_speed_lower]

    @property
    def fan_modes(self):
        """Return the list of available fan modes."""
        return FAN_MODES

    @property
    def swing_mode(self) -> str | None:
        """Return the swing mode setting."""
        return self._unit.swing

    @property
    def swing_modes(self) -> list[str] | None:
        """Return swing modes if supported."""
        return SWING_MODES if self.swing_mode is not None else None

    async def async_set_temperature(self, **kwargs: Any) -> None:
        """Set new target temperatures."""

Review comment (suggestion):
So we only create issues or repairs when they are user actionable, an action can be "disable entity x". This is to make sure we don't overload the issued raised. Opening an issue isn't really considered an action within Home Assistant.

While it does get less attention, I think we should log this on warning to alert users. While not ideal it's currently the only way we could handle this 

Code after:

    @property
    def hvac_mode(self):
        """Return hvac target hvac state."""
        mode = self._unit.mode
        if not self._unit.is_on:
            return HVACMode.OFF

        return CM_TO_HA_STATE[mode]

    @property
    def fan_mode(self):
        """Return the fan setting."""

        # Normalize to lowercase for lookup, and pass unknown lowercase values through.
        fan_speed_lower = self._unit.fan_speed.lower()
        if fan_speed_lower not in CM_TO_HA_FAN:
            # TODO(2026.7.0): Stop supporting unknown fan speeds.
            if fan_speed_lower not in CoolmasterClimate.warned_unknown_fan_speeds:
                CoolmasterClimate.warned_unknown_fan_speeds.add(fan_speed_lower)
                _LOGGER.warning(
                    "Detected unknown fan speed value from HVAC unit: %s. "
                    "Support for unknown fan speeds will be removed in 2026.7.0",
                    fan_speed_lower,
                )
            return fan_speed_lower

        return CM_TO_HA_FAN[fan_speed_lower]

    @property
    def fan_modes(self):
        """Return the list of available fan modes."""
        return FAN_MODES

    @property
    def swing_mode(self) -> str | None:
        """Return the swing mode setting."""
        return self._unit.swing

    @property
    def swing_modes(self) -> list[str] | None:
        """Return swing modes if supported."""
        return SWING_MODES if self.swing_mode is not None else None

    async def async_set_temperature(self, **kwargs: Any) -> None:
        """Set new target temperatures."""
        if (temp := kwargs.get(ATTR_TEMPERATURE)) is not None:
            _LOGGER.debug("Setting temp of %s to %s", self.unique_id, str(temp))
            self._unit = await self._unit.set_thermostat(temp)
            self.async_write_ha_state()