def handle_weatherstation_PUT(request):
    data = request.content.read()
    content_type = request.getHeader('Content-Type')
    dic = deserialize(data, content_type)
    status = weatherstation.update(dic, content_type)

    return make_response(weatherstation, request=request, status=status)
示例#2
0
def handle_display_PUT(request):
    content_type = request.getHeader('Content-Type')
    data = request.content.read()
    dic = deserialize(data, content_type)
    display.update(dic, content_type)
    cors(request, methods=['GET', 'PUT'])
    return make_response(display, request)
def handle_sensor_PUT(request):
    data = request.content.read()
    content_type = request.getHeader('Content-Type')
    dic = deserialize(data, content_type)
    sensing_device.update(dic, content_type)
    cors(request, methods=['GET', 'PUT'])
    return make_response(sensing_device, request)
示例#4
0
def handle_dht22_PUT(request):
    data = request.data
    content_type = request.headers.get("Content-Type")
    dic = deserialize(data, content_type)
    dht.update(dic, content_type)
    cors(request, methods=['GET'])
    return make_response(dht, request)
示例#5
0
def handle_waterdispenser_valve_PUT(request):
    data = request.content.read()
    content_type = request.getHeader('Content-Type')
    dic = deserialize(data, content_type)
    status = valve.update(dic, content_type)
    cors(request, methods=['GET', 'PUT', 'OPTIONS'])
    return make_response(valve, request=request, status=status)
示例#6
0
def handle_lightbulb_PUT(request):
    data = request.content.read()
    content_type = request.getHeader("Content-Type")
    dic = deserialize(data, content_type)
    status = lightbulb.update(dic, content_type)
    cors(request, methods=["GET", "PUT", "OPTIONS"])
    return make_response(lightbulb, request=request, status=status)
示例#7
0
def handle_window_lock_PUT(request):
    data = request.content.read()
    content_type = request.getHeader('Content-Type')
    dic = deserialize(data, content_type)
    lock.update(dic, content_type)
    cors(request, methods=['GET', 'PUT'])
    return make_response(lock, request)
def handle_weatherstation_sensors_temperature2_GET(request):
    return make_response(temperature_2, request)
示例#9
0
def handle_weatherstation_gps_GET(request):
    return make_response(gps, request)
示例#10
0
def handle_weatherstation_sensors_altitude_GET(request):
    cors(request, methods=['GET'])
    return make_response(altitude_sensor, request)
示例#11
0
def handle_waterdispenser_sensor_GET(request):
    cors(request, methods=['GET', 'OPTIONS'])
    return make_response(sensor, request)
示例#12
0
def handle_window_shutter_GET(request):
    cors(request, methods=['GET', 'PUT', 'OPTIONS'])
    return make_response(shutter, request)
示例#13
0
def handle_window_lock_GET(request):
    cors(request, methods=['GET', 'PUT'])
    return make_response(lock, request)
示例#14
0
def handle_weatherstation_sensors_GET(request):
    cors(request, methods=['GET'])
    return make_response(sensor_collection, request)
示例#15
0
def handle_weatherstation_sensors_pressure_GET(request):
    cors(request, methods=["GET"])
    return make_response(pressure_sensor, request)
示例#16
0
def handle_waterdispenser_valve_GET(request):
    cors(request, methods=['GET', 'PUT', 'OPTIONS'])
    return make_response(valve, request)
示例#17
0
def handle_weatherstation_sensors_humidity_GET(request):
    return make_response(humidity_sensor, request)
示例#18
0
def handle_lightbulb_GET(request):
    cors(request, methods=["GET", "PUT", "OPTIONS"])
    return make_response(lightbulb, request)
def handle_sensor_humidity_GET(request):
    cors(request, methods=['GET'])
    return make_response(humidity_sensor, request)
示例#20
0
def handle_dht22_humidity_GET(request):
    cors(request, methods=['GET'])
    return make_response(dht_humidity, request)
def handle_sensor_temperature_GET(request):
    cors(request, methods=["GET"])
    return make_response(temperature_sensor, request)
示例#22
0
def handle_weatherstation_sensors_color_GET(request):
    return make_response(color_sensor, request)
示例#23
0
def handle_weatherstation_sensors_illuminance_GET(request):
    return make_response(illuminance_sensor, request)
示例#24
0
def handle_door_handle_GET(request):
    cors(request, methods=['GET', 'PUT', 'OPTIONS'])
    return make_response(handle, request)
示例#25
0
def handle_display_GET(request):
    cors(request, methods=['GET', 'PUT'])
    return make_response(display, request)
示例#26
0
def handle_room_GET(request):
    return make_response(room, request)
示例#27
0
def handle_weatherstation_sensors_humidity_GET(request):
    cors(request, methods=['GET'])
    return make_response(humidity_sensor, request)
示例#28
0
def handle_room_PUT(request):
    data = request.content.read()
    content_type = request.getHeader('Content-Type')
    dic = deserialize(data, content_type)
    room.update(dic, content_type)
    return make_response(room, request)
示例#29
0
def handle_weatherstation_sensors_altitude_GET(request):
    return make_response(altitude_sensor, request)
示例#30
0
def handle_weatherstation_sensors_illuminance_GET(request):
    cors(request, methods=["GET"])
    return make_response(illuminance_sensor, request)