final for Robin
This commit is contained in:
1 parent
e138ec8c2e
commit
9e06bd387a
6 files changed
+6
-10
No files matched your search
@@ -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
|
||||
|
||||
+3
-2
@@ -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"
|
||||
@@ -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}
|
||||
@@ -1 +0,0 @@
|
||||
config = {"ssid": "Oppa-95.lan", "user_id": "1", "password": "95%04-MM", "pin": "9941"}
|
||||
+1
-4
@@ -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']
|
||||
|
||||
Reference in new issue
Block a user