def device_state ( device_id ) : if device_id not in devices : return jsonify ( success = False ) return jsonify ( state = devices [ device_id ] . state )
requests python json expecting value
Get device state via HTTP GET .
def device_state(device_id):
    """ Get device state via HTTP GET. """
    if device_id not in devices:
        return jsonify(success=False)
    return jsonify(state=devices[device_id].state)