コード例 #1
0
def get_relais(relay=None):

    if relay is None:
        response = []
        for relay, status in enumerate(relays_proxy.get_relays()):
            response.append(relay_result(relay, status))
    else:
        response = relay_result(relay, relais_proxy.get_relay(relay))

    return jsonify(payload=response)
コード例 #2
0
def get_relais(relay=None):

    if relay is None:
        response = []
        for relay, status in enumerate(relays_proxy.get_relays()):
            response.append(relay_result(relay, status))
    else:
        response = relay_result(relay, relais_proxy.get_relay(relay))

    return jsonify(payload=response)
コード例 #3
0
def reset_relais(relay):

    if check_permission(relay):
        relays_proxy.set_relay(relay, False)
    else:
        return auth_required()

    return jsonify(payload=relay_result(relay, False))
コード例 #4
0
def reset_relais(relay):

    if check_permission(relay):
        relays_proxy.set_relay(relay, False)
    else:
        return auth_required()

    return jsonify(payload=relay_result(relay, False))