diff --git a/gs/classes/http_request.py b/gs/classes/http_request.py index c85063c..de04b87 100644 --- a/gs/classes/http_request.py +++ b/gs/classes/http_request.py @@ -51,7 +51,8 @@ class HttpRequest: # Encode the values in the dictionary encoded_content = {} for key, value in parsed_content.items(): - encoded_value = re.sub(r'%([0-9A-Fa-f]{2})', lambda m: chr(int(m.group(1), 16)), value) + encoded_value = re.sub(r'\%([0-9A-Fa-f]{2})', lambda m: chr(int(m.group(1), 16)), value) + print("encoding ...", key, value, encoded_value) encoded_content[key] = encoded_value return encoded_content diff --git a/gs/config/app.py b/gs/config/app.py index 939fb3e..963a867 100644 --- a/gs/config/app.py +++ b/gs/config/app.py @@ -1,3 +1,4 @@ +dev_api_url = 'api.growsystem.muellerdev.kozow.com' api_url = 'api.growsystem.muellerdev.kozow.com' -read_secs = 1 * 60 -token = "lIEOISAH4DUfNvNP" +read_secs = 15 * 60 +token = "dummy" diff --git a/gs/config/device_config.json b/gs/config/device_config.json deleted file mode 100644 index 0425b62..0000000 --- a/gs/config/device_config.json +++ /dev/null @@ -1 +0,0 @@ -{"sensors": [{"pin_int": 15, "type": "dht22"}, {"pin_int": 26, "type": "moisture"}], "device_id": 10, "name": "Proto Robin", "token": "lIEOISAH4DUfNvNP", "user_id": 1} \ No newline at end of file diff --git a/gs/config/initial_config.py b/gs/config/initial_config.py deleted file mode 100644 index 8095a07..0000000 --- a/gs/config/initial_config.py +++ /dev/null @@ -1 +0,0 @@ -config = {"ssid": "Oppa-95.lan", "user_id": "1", "password": "95%04-MM", "pin": "9941"} \ No newline at end of file diff --git a/gs/growsystem.py b/gs/growsystem.py index f5fb200..348550d 100644 --- a/gs/growsystem.py +++ b/gs/growsystem.py @@ -35,7 +35,7 @@ class GrowSystem: print("Start reading sensors ...") read_secs = self.device_info.app_config().read_secs - + print("Reading and sending every " + str(read_secs) + " seconds") while True: # Reset data self.most_recent_values = [] @@ -59,7 +59,6 @@ class GrowSystem: print("Device Config:", device_config['data'], device_config['data']['token']) th.write_token(device_config['data']['token']) self.write_device_infos(device_config['data']) - machine.reset() def update_device_info(self): print("Start Device Info Update!") @@ -88,8 +87,6 @@ class GrowSystem: f.write(ujson.dumps(device_configs)) f.close() - - def _initialize_sensors(self): # Init sensors sensors = self.device_info.config()['sensors'] diff --git a/setup/little_apache.py b/setup/little_apache.py index dfb1ae6..baacc95 100644 --- a/setup/little_apache.py +++ b/setup/little_apache.py @@ -168,7 +168,6 @@ select {{ body = f"""
Unknown page
""" - html = '' html_arr = [header, body, footer] html = html.join(html_arr)