def color_mode(self):
        """Return the color mode of the light."""
        if self._attr_color_mode is not None:
            return self._attr_color_mode
        supported = self.supported_color_modes
        if ColorMode.HS in supported and self.hs_color is not None:
            return ColorMode.HS
        if ColorMode.COLOR_TEMP in supported and self.color_temp_kelvin is not None:
            return ColorMode.COLOR_TEMP
        if ColorMode.BRIGHTNESS in supported and self.brightness is not None:
            return ColorMode.BRIGHTNESS
        if ColorMode.ONOFF in supported:
            return ColorMode.ONOFF
        return ColorMode.UNKNOWN
Return the color mode of the light.
custom_components/xiaomi_miot/light.py