1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 09:38:58 +01:00

Improve flux_led light type hints (#161760)

This commit is contained in:
epenet
2026-01-28 11:20:57 +01:00
committed by GitHub
parent a94d39e493
commit 6409574ecf
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -19,6 +19,7 @@ from homeassistant.components.light import (
ATTR_RGBW_COLOR,
ATTR_RGBWW_COLOR,
ATTR_WHITE,
ColorMode,
LightEntity,
LightEntityFeature,
)
@@ -235,7 +236,7 @@ class FluxLight(
return self._device.rgbcw
@property
def color_mode(self) -> str:
def color_mode(self) -> ColorMode:
"""Return the color mode of the light."""
return _flux_color_mode_to_hass(
self._device.color_mode, self._device.color_modes
+1 -1
View File
@@ -11,7 +11,7 @@ from homeassistant.util.color import color_hsv_to_RGB, color_RGB_to_hsv
from .const import FLUX_COLOR_MODE_TO_HASS, MIN_RGB_BRIGHTNESS
def _hass_color_modes(device: AIOWifiLedBulb) -> set[str]:
def _hass_color_modes(device: AIOWifiLedBulb) -> set[ColorMode]:
color_modes = device.color_modes
if not color_modes:
return {ColorMode.ONOFF}