How to use the yeelight.transitions.TemperatureTransition function in yeelight

To help you get started, we’ve selected a few yeelight examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skorokithakis / yeecli / yeecli / cli.py View on Github external
def sunrise(duration):
    """Simulate sunrise in seconds (default 5min)."""
    click.echo("Good morning!")
    # We're using seconds for duration because it's a more natural timescale
    # for this preset.
    duration = duration * 1000
    transitions = [
        # First set to minimum temperature, low brightness, nearly immediately.
        tr.TemperatureTransition(1700, duration=50, brightness=1),
        # Then slowly transition to higher temperature, max brightness.
        # 5000 is about regular daylight white.
        tr.TemperatureTransition(2100, duration=duration / 2, brightness=50),
        tr.TemperatureTransition(5000, duration=duration / 2, brightness=100),
    ]
    flow = yeelight.Flow(count=1, action=yeelight.flow.Action.stay, transitions=transitions)
    for bulb in BULBS:
        bulb.start_flow(flow)
github skorokithakis / yeecli / yeecli / cli.py View on Github external
def sunrise(duration):
    """Simulate sunrise in seconds (default 5min)."""
    click.echo("Good morning!")
    # We're using seconds for duration because it's a more natural timescale
    # for this preset.
    duration = duration * 1000
    transitions = [
        # First set to minimum temperature, low brightness, nearly immediately.
        tr.TemperatureTransition(1700, duration=50, brightness=1),
        # Then slowly transition to higher temperature, max brightness.
        # 5000 is about regular daylight white.
        tr.TemperatureTransition(2100, duration=duration / 2, brightness=50),
        tr.TemperatureTransition(5000, duration=duration / 2, brightness=100),
    ]
    flow = yeelight.Flow(count=1, action=yeelight.flow.Action.stay, transitions=transitions)
    for bulb in BULBS:
        bulb.start_flow(flow)
github skorokithakis / yeecli / yeecli / cli.py View on Github external
def sunrise(duration):
    """Simulate sunrise in seconds (default 5min)."""
    click.echo("Good morning!")
    # We're using seconds for duration because it's a more natural timescale
    # for this preset.
    duration = duration * 1000
    transitions = [
        # First set to minimum temperature, low brightness, nearly immediately.
        tr.TemperatureTransition(1700, duration=50, brightness=1),
        # Then slowly transition to higher temperature, max brightness.
        # 5000 is about regular daylight white.
        tr.TemperatureTransition(2100, duration=duration / 2, brightness=50),
        tr.TemperatureTransition(5000, duration=duration / 2, brightness=100),
    ]
    flow = yeelight.Flow(count=1, action=yeelight.flow.Action.stay, transitions=transitions)
    for bulb in BULBS:
        bulb.start_flow(flow)