Use built-in set methods for light supported checks (#106625)

This commit is contained in:
J. Nick Koston 2023-12-28 21:37:44 -10:00 committed by GitHub
parent 03fcb81a59
commit 7702f971fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: