Make HSV NamedTuple creation more efficient (#1211)

This commit is contained in:
Steven B.
2024-10-29 17:14:52 +00:00
committed by GitHub
parent 6d8dc1cc5f
commit 673a32258f
2 changed files with 6 additions and 2 deletions

View File

@@ -367,7 +367,9 @@ class IotBulb(IotDevice):
saturation = light_state["saturation"]
value = self._brightness
return HSV(hue, saturation, value)
# Simple HSV(hue, saturation, value) is less efficent than below
# due to the cpython implementation.
return tuple.__new__(HSV, (hue, saturation, value))
@requires_update
async def _set_hsv(