Beispiel #1
0
def update_fans():
    if request.headers['Content-Type'] != 'application/json':
        print("ERROR: Content type is not JSON in HTTP header.")
    elif request.is_json:
        return SensorController.update_fans(request)
    else:
        print("ERROR: Request is not JSON.")

    return ('', 204)
Beispiel #2
0
def update_fans():
    """
    UPDATE FANS et GET FANS
    POST: C'est la requête à faire pour modifier la vitesse d'un ventilateur

    Le POST peut être testé avec ce JSON:
    {"fanl": 255, "fanh": 255}
    """
    if request.headers['Content-Type'] != 'application/json':
        print("ERROR: Content type is not JSON in HTTP header.")
    elif request.is_json:
        return SensorController.update_fans(request)
    else:
        print("ERROR: Request is not JSON.")

    return ('', 204)