gazoodle / gecko-home-assistant

Home Assistant integration for spas equipped with Gecko Alliance in.touch2 modules
MIT License
67 stars 22 forks source link

light should set supported color modes #105

Open llamafilm opened 3 months ago

llamafilm commented 3 months ago

I noticed this warning in Home Assistant 2024.5. Using component version 0.1.9.

Logger: homeassistant.components.light
Source: components/light/__init__.py:1267
integration: Light (documentation, issues)
First occurred: 4:00:51 PM (1 occurrences)
Last logged: 4:00:51 PM

None (<class 'custom_components.gecko.light.GeckoLight'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3, please create a bug report at https://github.com/gazoodle/gecko-home-assistant/issues

I don't have time to make a PR right now, but it looks like it should be something like this in light.py:

from homeassistant.components.light import LightEntity, ColorMode

# inside the GeckoLight class:
    _attr_supported_color_modes = set(ColorMode.ONOFF)
    _attr_color_mode = ColorMode.ONOFF
llamafilm commented 3 months ago

More related deprecation warnings:

2024-06-16 19:03:55.290 WARNING (ImportExecutor_0) [homeassistant.components.fan] SUPPORT_PRESET_MODE was used from gecko, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.PRESET_MODE instead, please report it to the author of the 'gecko' custom integration
2024-06-16 19:03:55.313 WARNING (ImportExecutor_0) [homeassistant.components.climate.const] HVAC_MODE_AUTO was used from gecko, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.AUTO instead, please report it to the author of the 'gecko' custom integration