You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
911 B
25 lines
911 B
from services import post_services, get_services |
|
|
|
''' |
|
API Functions |
|
====================================================================== |
|
These functions are what are exposed/referenced in the swagger.yml |
|
file -- they are essentially wrapper functions. The main work is done |
|
in the files in the /services/ folder. |
|
These functions are acting as very light controllers essentially. |
|
''' |
|
|
|
def post_a_reading(light_meter, the_reading): |
|
return post_services.add_latest_reading(light_meter, the_reading) |
|
|
|
def post_a_status_change(device, the_status_change): |
|
return post_services.log_status_change(device, the_status_change) |
|
|
|
def get_latest(light_meter): |
|
return get_services.get_latest_reading(light_meter) |
|
|
|
def get_all_readings(light_meter): |
|
return get_services.get_all_readings_from_table(light_meter) |
|
|
|
def get_all_readings_for_every_meter(): |
|
return get_services.get_all_readings_from_database()
|
|
|