diff --git a/swarm/swarm.py b/swarm/swarm.py index ac1115c..18be679 100644 --- a/swarm/swarm.py +++ b/swarm/swarm.py @@ -531,6 +531,9 @@ async def get_color(self) -> int: return self._color async def set_color(self, color) -> None: + # If color is a tuple, reformat it as hex + if isinstance(color, tuple) or isinstance(color, list): + color = (color[0] << 16) + (color[1] << 8) + color[2] self._color = color await self._swarm.send(self._port_name, "setColor", color)