Skip to content

Commit

Permalink
yeelight bedside: fix set_name and set_color_temp
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Dec 11, 2018
1 parent 9ba523c commit e10468f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions miio/yeelight.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def set_color_temp(self, level, transition=500):
if transition > 0:
return self.send("set_ct_abx", [level, "smooth", transition])
else:
return self.send("set_ct_abx", [level])
# Bedside lamp requires transition
return self.send("set_ct_abx", [level, "sudden", 0])

@command(
click.argument("rgb", default=[255] * 3, type=click.Tuple([int, int, int])),
Expand Down Expand Up @@ -234,8 +235,8 @@ def set_save_state_on_change(self, enable: bool) -> bool:
return self.send("set_ps", ["cfg_save_state", str(int(enable))])

@command(
click.argument("name", type=bool),
default_output=format_output("Setting name to {enable}")
click.argument("name", type=str),
default_output=format_output("Setting name to {name}")
)
def set_name(self, name: str) -> bool:
"""Set an internal name for the bulb."""
Expand Down

0 comments on commit e10468f

Please sign in to comment.