Skip to content

Commit

Permalink
feat: Add presets.
Browse files Browse the repository at this point in the history
  • Loading branch information
skorokithakis committed Nov 15, 2016
1 parent de183fe commit a14b675
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion yeecli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ def turn(state):
bulb.turn_off()


@cli.command()
@cli.group()
def preset():
"""Various presets."""


@preset.command()
def disco():
"""Party!"""
click.echo("Party mode: activated.")
Expand All @@ -190,6 +195,32 @@ def disco():
bulb.start_flow(flow)


@preset.command()
def strobe():
"""Epilepsy warning."""
click.echo("Strobing.")
transitions = [
yeelight.flow.HSVTransition(0, 0, duration=50, brightness=100),
yeelight.flow.HSVTransition(0, 0, duration=50, brightness=1),
]
flow = yeelight.Flow(count=0, transitions=transitions)
for bulb in BULBS:
bulb.start_flow(flow)


@preset.command()
def temp():
"""Slowly-changing color temperature."""
click.echo("Enjoy.")
transitions = [
yeelight.flow.TemperatureTransition(1700, duration=40000),
yeelight.flow.TemperatureTransition(6500, duration=40000),
]
flow = yeelight.Flow(count=0, transitions=transitions)
for bulb in BULBS:
bulb.start_flow(flow)


@cli.command()
def save():
"""Save the current settings as default."""
Expand Down

0 comments on commit a14b675

Please sign in to comment.