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:
@@ -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
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user