final for Robin

This commit is contained in:
Maik Müller 2024-05-09 17:14:36 +02:00
parent e138ec8c2e
commit 9e06bd387a
6 changed files with 6 additions and 10 deletions

View File

@ -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

View File

@ -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"

View File

@ -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}

View File

@ -1 +0,0 @@
config = {"ssid": "Oppa-95.lan", "user_id": "1", "password": "95%04-MM", "pin": "9941"}

View File

@ -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']

View File

@ -168,7 +168,6 @@ select {{
body = f"""
<div>Unknown page</div>
"""
html = ''
html_arr = [header, body, footer]
html = html.join(html_arr)