コード例 #1
0
ファイル: light.py プロジェクト: Longi94/ender-rgb
def off():
    strip.off()
    return ok()
コード例 #2
0
ファイル: light.py プロジェクト: Longi94/ender-rgb
def set_effect(effect_name):
    try:
        strip.set_effect(effect_name)
    except NameError:
        raise BadRequestException('effect does not exist')
    return ok()
コード例 #3
0
ファイル: light.py プロジェクト: Longi94/ender-rgb
def stop_effect():
    strip.stop_effect()
    return ok()
コード例 #4
0
ファイル: light.py プロジェクト: Longi94/ender-rgb
def get_effects():
    return ok(None, strip.get_effect_names())
コード例 #5
0
ファイル: light.py プロジェクト: Longi94/ender-rgb
def set_color():
    body = request.json
    strip.set_color(body['r'], body['g'], body['b'])
    return ok()
コード例 #6
0
ファイル: light.py プロジェクト: Longi94/ender-rgb
def get_colors():
    colors = strip.get_colors()
    return ok(None, colors)