Skip to content

Commit

Permalink
Use a more compact approach
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Dec 12, 2018
1 parent 2b104b4 commit 3a1547a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions miio/philips_moonlight.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def set_rgb(self, rgb: Tuple[int, int, int]):
if color < 0 or color > 255:
raise PhilipsMoonlightException("Invalid color: %s" % color)

return self.send("set_rgb", list(rgb))
return self.send("set_rgb", [*rgb])

@command(
click.argument("level", type=int),
Expand Down Expand Up @@ -241,9 +241,7 @@ def set_brightness_and_rgb(self, brightness: int, rgb: Tuple[int, int, int]):
if color < 0 or color > 255:
raise PhilipsMoonlightException("Invalid color: %s" % color)

params = list(rgb)
params.append(brightness)
return self.send("set_brirgb", params)
return self.send("set_brirgb", [*rgb, brightness])

@command(
click.argument("number", type=int),
Expand Down

0 comments on commit 3a1547a

Please sign in to comment.