mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Make HSV NamedTuple creation more efficient (#1211)
This commit is contained in:
@@ -44,7 +44,9 @@ class Color(SmartModule):
|
||||
self.data.get("brightness", 0),
|
||||
)
|
||||
|
||||
return HSV(hue=h, saturation=s, value=v)
|
||||
# Simple HSV(h, s, v) is less efficent than below
|
||||
# due to the cpython implementation.
|
||||
return tuple.__new__(HSV, (h, s, v))
|
||||
|
||||
def _raise_for_invalid_brightness(self, value):
|
||||
"""Raise error on invalid brightness value."""
|
||||
|
Reference in New Issue
Block a user