From e6c792deed7ba119aff7cb000a73948989db888c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 21 Feb 2023 14:23:53 -0600 Subject: [PATCH] Add missing kelvin attributes to light recorder platform (#88561) --- homeassistant/components/light/recorder.py | 4 ++++ tests/components/light/test_recorder.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/homeassistant/components/light/recorder.py b/homeassistant/components/light/recorder.py index 9febb98fa41..e38ba888e71 100644 --- a/homeassistant/components/light/recorder.py +++ b/homeassistant/components/light/recorder.py @@ -5,7 +5,9 @@ from homeassistant.core import HomeAssistant, callback from . import ( ATTR_EFFECT_LIST, + ATTR_MAX_COLOR_TEMP_KELVIN, ATTR_MAX_MIREDS, + ATTR_MIN_COLOR_TEMP_KELVIN, ATTR_MIN_MIREDS, ATTR_SUPPORTED_COLOR_MODES, ) @@ -19,4 +21,6 @@ def exclude_attributes(hass: HomeAssistant) -> set[str]: ATTR_EFFECT_LIST, ATTR_MIN_MIREDS, ATTR_MAX_MIREDS, + ATTR_MIN_COLOR_TEMP_KELVIN, + ATTR_MAX_COLOR_TEMP_KELVIN, } diff --git a/tests/components/light/test_recorder.py b/tests/components/light/test_recorder.py index a4822b3cd74..b4e0621d23d 100644 --- a/tests/components/light/test_recorder.py +++ b/tests/components/light/test_recorder.py @@ -6,7 +6,9 @@ from datetime import timedelta from homeassistant.components import light from homeassistant.components.light import ( ATTR_EFFECT, + ATTR_MAX_COLOR_TEMP_KELVIN, ATTR_MAX_MIREDS, + ATTR_MIN_COLOR_TEMP_KELVIN, ATTR_MIN_MIREDS, ATTR_SUPPORTED_COLOR_MODES, ) @@ -53,3 +55,5 @@ async def test_exclude_attributes(recorder_mock: Recorder, hass: HomeAssistant) assert ATTR_SUPPORTED_COLOR_MODES not in state.attributes assert ATTR_EFFECT not in state.attributes assert ATTR_FRIENDLY_NAME in state.attributes + assert ATTR_MAX_COLOR_TEMP_KELVIN not in state.attributes + assert ATTR_MIN_COLOR_TEMP_KELVIN not in state.attributes