Tinkered with the vitalsd prototype so that it works given recent commits
This commit is contained in:
parent
2582c4c4ee
commit
224b03125c
|
@ -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.")
|
||||
|
||||
|
|
Loading…
Reference in a new issue