Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yeelight bedside: fix set_name and set_color_temp #434

Merged
merged 1 commit into from
Dec 11, 2018
Merged
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
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