From c7bfb3da9231c85b4d5669f761bbc7beac7d6417 Mon Sep 17 00:00:00 2001 From: DewGew Date: Mon, 5 Feb 2024 14:47:22 +0100 Subject: [PATCH] Add check state --- modules/routes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/routes.py b/modules/routes.py index 2ed809a..b9ac6a4 100644 --- a/modules/routes.py +++ b/modules/routes.py @@ -63,6 +63,7 @@ def devices(): camurl = request.form.get('camurl') actual_temp_idx = request.form.get('actual_temp_idx') selector_modes_idx = request.form.get('selector_modes_idx') + check_state = request.form.get('checkState') if idx not in deviceconfig.keys(): deviceconfig[idx] = {} @@ -76,6 +77,11 @@ def devices(): deviceconfig[idx].update({'report_state': False}) elif idx in deviceconfig.keys() and 'report_state' in deviceconfig[idx]: deviceconfig[idx].pop('report_state') + + if check_state != 'on': + deviceconfig[idx].update({'check_state': False}) + elif idx in deviceconfig.keys() and 'check_state' in deviceconfig[idx]: + deviceconfig[idx].pop('check_state') if challenge == 'ackNeeded': deviceconfig[idx].update({'ack': True})