From 78635e6695bf920cf008aa4a0b9badafdee93087 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 29 Oct 2021 09:28:13 +0200 Subject: [PATCH] Tweak --- homeassistant/components/light/__init__.py | 8 ++++---- homeassistant/util/color.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index a09a2fcd58..e04ab70eb9 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -211,16 +211,16 @@ LIGHT_TURN_ON_SCHEMA = { vol.Coerce(tuple), ), vol.Exclusive(ATTR_RGB_COLOR, COLOR_GROUP): vol.All( - vol.ExactSequence((cv.byte,) * 3), vol.Coerce(tuple) + vol.Coerce(tuple), vol.ExactSequence((cv.byte,) * 3) ), vol.Exclusive(ATTR_RGBW_COLOR, COLOR_GROUP): vol.All( - vol.ExactSequence((cv.byte,) * 4), vol.Coerce(tuple) + vol.Coerce(tuple), vol.ExactSequence((cv.byte,) * 4) ), vol.Exclusive(ATTR_RGBWW_COLOR, COLOR_GROUP): vol.All( - vol.ExactSequence((cv.byte,) * 5), vol.Coerce(tuple) + vol.Coerce(tuple), vol.ExactSequence((cv.byte,) * 5) ), vol.Exclusive(ATTR_XY_COLOR, COLOR_GROUP): vol.All( - vol.ExactSequence((cv.small_float, cv.small_float)), vol.Coerce(tuple) + vol.Coerce(tuple), vol.ExactSequence((cv.small_float, cv.small_float)) ), vol.Exclusive(ATTR_WHITE, COLOR_GROUP): VALID_BRIGHTNESS, ATTR_WHITE_VALUE: vol.All(vol.Coerce(int), vol.Range(min=0, max=255)), diff --git a/homeassistant/util/color.py b/homeassistant/util/color.py index 62e179f950..1cfd6447e8 100644 --- a/homeassistant/util/color.py +++ b/homeassistant/util/color.py @@ -196,7 +196,7 @@ class GamutType: blue: XYPoint = attr.ib() -def color_name_to_rgb(color_name: str) -> tuple[int, int, int]: +def color_name_to_rgb(color_name: str) -> RGBColor: """Convert color name to RGB hex value.""" # COLORS map has no spaces in it, so make the color_name have no # spaces in it as well for matching purposes @@ -204,7 +204,7 @@ def color_name_to_rgb(color_name: str) -> tuple[int, int, int]: if not hex_value: raise ValueError("Unknown color") - return tuple(hex_value) # type: ignore[return-value] + return hex_value # pylint: disable=invalid-name