From 7702f971fbb6e89d6510c716352fd08d2e85d1f0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 28 Dec 2023 21:37:44 -1000 Subject: [PATCH] Use built-in set methods for light supported checks (#106625) --- homeassistant/components/light/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index ebd3696d61f..77510b02035 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -160,14 +160,14 @@ def brightness_supported(color_modes: Iterable[ColorMode | str] | None) -> bool: """Test if brightness is supported.""" if not color_modes: return False - return any(mode in COLOR_MODES_BRIGHTNESS for mode in color_modes) + return not COLOR_MODES_BRIGHTNESS.isdisjoint(color_modes) def color_supported(color_modes: Iterable[ColorMode | str] | None) -> bool: """Test if color is supported.""" if not color_modes: return False - return any(mode in COLOR_MODES_COLOR for mode in color_modes) + return not COLOR_MODES_COLOR.isdisjoint(color_modes) def color_temp_supported(color_modes: Iterable[ColorMode | str] | None) -> bool: