diff --git a/src/modules/vitalsd/vitalsd.py b/src/modules/vitalsd/vitalsd.py index 4da3ea0..12e34f2 100644 --- a/src/modules/vitalsd/vitalsd.py +++ b/src/modules/vitalsd/vitalsd.py @@ -50,8 +50,9 @@ urlAddCyberware = urlBase + '/api/cyberware/add' # Add to Cyberware and get UUID uuidRequest = requests.post(urlAddCyberware, json={ 'name': "PineTime", 'hotpluggable': True, 'canSet': [ '/api/vitals/heartrate', '/api/fitness/steps' ] }) -if(uuidRequest.status_code == 204): - uuid = uuidRequest.json()['uuid'] +if(uuidRequest.status_code == 200): + uuid = uuidRequest.json()[0]['uuid'] + print(uuid) else: sys.exit("Failed to get UUID") @@ -62,8 +63,8 @@ while True: steps = getSteps() #battery = getBattery() - requests.post(urlHeartrate, json={ 'heartrate': heartrate, 'uuid': uuid } ) - requests.post(urlSteps, json={ 'steps': steps, 'uuid': uuid }) + heartrateRequest = requests.post(urlHeartrate, json={ 'heartrate': heartrate, 'uuid': uuid } ) + stepsRequest = requests.post(urlSteps, json={ 'steps': steps, 'uuid': uuid }) except: print("An exception occured. TODO: Exception report to frontend.")