|
|
|
@ -30,8 +30,9 @@ def add_latest_reading(meter, info):
|
|
|
|
|
return make_response("Meter Id. not recognised. Must be between 1 and 3.", 400) |
|
|
|
|
return make_response("Invalid token.", 400) |
|
|
|
|
|
|
|
|
|
def log_status_change(device, status): |
|
|
|
|
# NEED TO ADD TOKEN. |
|
|
|
|
def log_status_change(device, info): |
|
|
|
|
if info["token"] == device_check_token: |
|
|
|
|
status = {"time":info["time"], "status":info["status"]} |
|
|
|
|
if device == 1: |
|
|
|
|
return add_status_change_to_device1(status) |
|
|
|
|
elif device == 2: |
|
|
|
@ -45,6 +46,7 @@ def log_status_change(device, status):
|
|
|
|
|
elif device == 6: |
|
|
|
|
return add_status_change_to_device6(status) |
|
|
|
|
return make_response("Device Id. not recognised. Must be between 1 and 6.", 400) |
|
|
|
|
return make_response("Invalid token.", 400) |
|
|
|
|
|
|
|
|
|
''' |
|
|
|
|
Nitty-Gritty Functions |
|
|
|
|