Skip to content
Snippets Groups Projects
Commit 4fb81b60 authored by Callum Inglis's avatar Callum Inglis
Browse files

Typo Fixes - getSensorConfig(...)

parent 265617e8
No related branches found
No related tags found
3 merge requests!12CO2 Sensor, Refactoring, CAD Files, Update Config from API,!7Update sensor config from api; CO2 Sensor; Refactor & Tidy-Up,!6Update sensor config from api; CO2 Sensor; Refactor & Tidy-Up
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
......@@ -126,7 +126,7 @@ class Co2(object):
class API():
def getSensorConfig(self, sensorUID):
headers = {'Content-Type': 'Application/json'}
response = requests.post(API_URL + '/api/' + secrets.API_KEY + '/sensor/getConfig/' + sensorUID, headers=headers)
response = requests.post(API_URL + '/' + secrets.API_KEY + '/sensor/getConfig/' + sensorUID, headers=headers)
if (response.status_code != 200):
return None
......@@ -282,8 +282,9 @@ def ackMsg(sensorResponse):
# Retrieve up-to-date sensor config from API & Transmit back to sensor
updated_sensor_config = API().getSensorConfig(sensorResponse.sensorMetadata.uid)
data.updateConfigPollingFrequency(updated_sensor_config['txAfterNReadings'])
data.updateConfigTxAfterNReadings(updated_sensor_config['pollingFrequency'])
if updated_sensor_config is not None:
data.updateConfigPollingFrequency(updated_sensor_config['txAfterNReadings'])
data.updateConfigTxAfterNReadings(updated_sensor_config['pollingFrequency'])
if DEBUG > 1:
print(data.ToJson())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment