Пример #1
0
def set_led():
    f = request.form
    rgbw_tuple = (int(f.get('r')), int(f.get('g')), int(f.get('b')),
                  int(f.get('w')))

    db.set_rule(Rules.OneTimeRule(datetime.datetime.now(), rgbw_tuple))
    return "Success!"
Пример #2
0
def set_onetime_rule():
    f = request.form
    rule_datetime = datetime.datetime(int(f.get('yr')), int(f.get('mon')),
                                      int(f.get('day')), int(f.get('hr')),
                                      int(f.get('min')))
    color_tuple = (int(f.get('r')), int(f.get('g')), int(f.get('b')),
                   int(f.get('w')))

    db.set_rule(Rules.OneTimeRule(rule_datetime, color_tuple))

    return "Success!"