Example #1
0
def group_switch_power(group_name):
    def action():
        group = Group(LAN, group_name)
        group.switch_power()
        return {"success": True}

    return flask_utils.wrapper(action)
Example #2
0
def group_set_power(group_name, value):
    def action():
        group = Group(LAN, group_name)
        data = flask_utils.get_data(request.data)
        group.set_power(value, duration=data["duration"], wait=data["wait"])
        return {"success": True}

    return flask_utils.wrapper(action)
Example #3
0
def group_get_power(group_name):
    def action():
        group = Group(LAN, group_name)
        return {"power": group.get_power()}

    return flask_utils.wrapper(action)
Example #4
0
def group_get_devices(group_name):
    def action():
        group = Group(LAN, group_name)
        return {"devices": group.get_devices_label()}

    return flask_utils.wrapper(action)
Example #5
0
def groups_stats():
    def action():
        return {"groups": Group.stats_group(LAN)}

    return flask_utils.wrapper(action)
Example #6
0
def groups_list():
    def action():
        return {"groups": Group.list_group(LAN)}

    return flask_utils.wrapper(action)
Example #7
0
def devices_list():
    def action():
        devices = [d.get_label() for d in LAN.get_devices()]
        return {"devices": devices}

    return flask_utils.wrapper(action)
Example #8
0
def hello():
    def action():
        return "Hey! Listen"

    return flask_utils.wrapper(action)
Example #9
0
def group_get_infrared(group_name):
    def action():
        group = Group(LAN, group_name)
        return {"infrared": group.get_infrared()}

    return flask_utils.wrapper(action)
Example #10
0
def group_get_colortemp(group_name):
    def action():
        group = Group(LAN, group_name)
        return {"colortemp": group.get_colortemp()}

    return flask_utils.wrapper(action)
Example #11
0
def group_get_brightness(group_name):
    def action():
        group = Group(LAN, group_name)
        return {"brightness": group.get_brightness()}

    return flask_utils.wrapper(action)
Example #12
0
def group_get_saturation(group_name):
    def action():
        group = Group(LAN, group_name)
        return {"saturation": group.get_saturation()}

    return flask_utils.wrapper(action)
Example #13
0
def group_get_hue(group_name):
    def action():
        group = Group(LAN, group_name)
        return {"hue": group.get_hue()}

    return flask_utils.wrapper(action)