Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion kasa/iot/iotbulb.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ def _hsv(self) -> HSV:
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(
Expand Down
4 changes: 3 additions & 1 deletion kasa/smart/modules/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def hsv(self) -> HSV:
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."""
Expand Down