示例#1
0
def build_button_idle_animation_directive(target_gadgets, animation):
    return SetLightDirective(version=1,
                             target_gadgets=target_gadgets,
                             parameters=SetLightParameters(
                                 trigger_event=TriggerEventType.none,
                                 trigger_event_time_ms=0,
                                 animations=[animation]))
def button_down_animation_directive(animation, target_gadgets=[]):
    """ returns a SetLight directive, with a 'buttonDown' trigger, that can be added to an Alexa skill response """
    return SetLightDirective(version=1,
                             target_gadgets=target_gadgets,
                             parameters=SetLightParameters(
                                 trigger_event=TriggerEventType.buttonDown,
                                 trigger_event_time_ms=0,
                                 animations=[animation]))
示例#3
0
def build_button_up_animation_directive(target_gadgets):
    return SetLightDirective(version=1,
                             target_gadgets=target_gadgets,
                             parameters=SetLightParameters(
                                 trigger_event=TriggerEventType.buttonUp,
                                 trigger_event_time_ms=0,
                                 animations=[
                                     LightAnimation(repeat=1,
                                                    target_lights=["1"],
                                                    sequence=[
                                                        AnimationStep(
                                                            duration_ms=300,
                                                            color="00FFFF",
                                                            blend=False)
                                                    ])
                                 ]))