diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3286bfb..0a1018c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,6 @@ - + + + poll_t + + @@ -113,8 +117,8 @@ @@ -283,8 +287,8 @@ - - + + diff --git a/index.py b/index.py index e36f24a..67e196c 100644 --- a/index.py +++ b/index.py @@ -40,7 +40,6 @@ def poll(): color_reference = image_tools.average_color(stall_obj['locationX'], stall_obj['locationY'], stall_obj['width'], stall_obj['height'], reference) color_compare = image_tools.average_color(stall_obj['locationX'], stall_obj['locationY'], stall_obj['width'], stall_obj['height'], img) stall_occupied = image_tools.threshold(image_tools.differences(color_reference, color_compare), float(doc_conf['e_hat'])) - print(doc_conf['e_hat']) stall_obj['open'] = not stall_occupied print("Updated: "+stall.id) @@ -51,7 +50,7 @@ start_time = time.time() while True: poll() - poll_time = float(os.getenv('POLL_FREQUENCY')) doc_conf = db.collection('configurations').document(os.getenv('CONFIG_CODE')).get().to_dict() print(doc_conf) + poll_time = float(doc_conf('frequency')) time.sleep(poll_time - ((time.time() - start_time) % poll_time))