Пример #1
0
def off():
    strip.off()
    return ok()
Пример #2
0
def set_effect(effect_name):
    try:
        strip.set_effect(effect_name)
    except NameError:
        raise BadRequestException('effect does not exist')
    return ok()
Пример #3
0
def stop_effect():
    strip.stop_effect()
    return ok()
Пример #4
0
def get_effects():
    return ok(None, strip.get_effect_names())
Пример #5
0
def set_color():
    body = request.json
    strip.set_color(body['r'], body['g'], body['b'])
    return ok()
Пример #6
0
def get_colors():
    colors = strip.get_colors()
    return ok(None, colors)