mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Remove unnecessary check in fritz light (#123829)
* Remove unnecessary check in fritz light * Revert remove SUPPORTED_COLOR_MODES
This commit is contained in:
parent
e6ed3c8c5c
commit
e6b3d35cdf
@ -17,7 +17,7 @@ from homeassistant.core import HomeAssistant, callback
|
|||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import FritzboxDataUpdateCoordinator, FritzBoxDeviceEntity
|
from . import FritzboxDataUpdateCoordinator, FritzBoxDeviceEntity
|
||||||
from .const import COLOR_MODE, COLOR_TEMP_MODE, LOGGER
|
from .const import COLOR_MODE, LOGGER
|
||||||
from .coordinator import FritzboxConfigEntry
|
from .coordinator import FritzboxConfigEntry
|
||||||
|
|
||||||
SUPPORTED_COLOR_MODES = {ColorMode.COLOR_TEMP, ColorMode.HS}
|
SUPPORTED_COLOR_MODES = {ColorMode.COLOR_TEMP, ColorMode.HS}
|
||||||
@ -80,11 +80,8 @@ class FritzboxLight(FritzBoxDeviceEntity, LightEntity):
|
|||||||
return (hue, float(saturation) * 100.0 / 255.0)
|
return (hue, float(saturation) * 100.0 / 255.0)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def color_temp_kelvin(self) -> int | None:
|
def color_temp_kelvin(self) -> int:
|
||||||
"""Return the CT color value."""
|
"""Return the CT color value."""
|
||||||
if self.data.color_mode != COLOR_TEMP_MODE:
|
|
||||||
return None
|
|
||||||
|
|
||||||
return self.data.color_temp # type: ignore [no-any-return]
|
return self.data.color_temp # type: ignore [no-any-return]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -180,6 +180,7 @@ class FritzDeviceLightMock(FritzEntityBaseMock):
|
|||||||
level = 100
|
level = 100
|
||||||
present = True
|
present = True
|
||||||
state = True
|
state = True
|
||||||
|
color_temp = None
|
||||||
|
|
||||||
|
|
||||||
class FritzDeviceCoverMock(FritzEntityBaseMock):
|
class FritzDeviceCoverMock(FritzEntityBaseMock):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user