From aafabc31a7a43ad86edc15fe35934d7ad5f1854e Mon Sep 17 00:00:00 2001 From: xZetsubou Date: Sat, 16 Mar 2024 10:40:51 +0300 Subject: [PATCH] Fix deprecated warnings if supported color modes is 1. #168 --- custom_components/localtuya/light.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/localtuya/light.py b/custom_components/localtuya/light.py index 3218c7d0..8c8480ad 100644 --- a/custom_components/localtuya/light.py +++ b/custom_components/localtuya/light.py @@ -303,6 +303,9 @@ def is_music_mode(self): @property def color_mode(self) -> ColorMode: """Return the color_mode of the light.""" + if len(self.supported_color_modes) == 1: + return next(iter(self.supported_color_modes)) + if self.is_color_mode: return ColorMode.HS if self.is_white_mode: