From e6b3d35cdf67d9d3410b336c0bce5728898b2754 Mon Sep 17 00:00:00 2001 From: Lars Date: Wed, 14 Aug 2024 22:53:29 +0200 Subject: [PATCH] Remove unnecessary check in fritz light (#123829) * Remove unnecessary check in fritz light * Revert remove SUPPORTED_COLOR_MODES --- homeassistant/components/fritzbox/light.py | 7 ++----- tests/components/fritzbox/__init__.py | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/fritzbox/light.py b/homeassistant/components/fritzbox/light.py index 65446dc3e04..1009b0fb368 100644 --- a/homeassistant/components/fritzbox/light.py +++ b/homeassistant/components/fritzbox/light.py @@ -17,7 +17,7 @@ from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.entity_platform import AddEntitiesCallback from . import FritzboxDataUpdateCoordinator, FritzBoxDeviceEntity -from .const import COLOR_MODE, COLOR_TEMP_MODE, LOGGER +from .const import COLOR_MODE, LOGGER from .coordinator import FritzboxConfigEntry SUPPORTED_COLOR_MODES = {ColorMode.COLOR_TEMP, ColorMode.HS} @@ -80,11 +80,8 @@ class FritzboxLight(FritzBoxDeviceEntity, LightEntity): return (hue, float(saturation) * 100.0 / 255.0) @property - def color_temp_kelvin(self) -> int | None: + def color_temp_kelvin(self) -> int: """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] @property diff --git a/tests/components/fritzbox/__init__.py b/tests/components/fritzbox/__init__.py index 09e0aeaee51..bd68615212d 100644 --- a/tests/components/fritzbox/__init__.py +++ b/tests/components/fritzbox/__init__.py @@ -180,6 +180,7 @@ class FritzDeviceLightMock(FritzEntityBaseMock): level = 100 present = True state = True + color_temp = None class FritzDeviceCoverMock(FritzEntityBaseMock):