def get_status(device): arduino = get_ip_from_device(device) arduino_request = ArduinoRequest() arduino_request.action = ArduinoRequest.STATUS response = arduino.request(arduino_request) return jsonify(response.__dict__)
def post_off(device): arduino = get_ip_from_device(device) arduino_request = ArduinoRequest() arduino_request.action = ArduinoRequest.OFF response = arduino.request(arduino_request) return jsonify(response.__dict__)