setValue ignored on /api/v1.0/chambers/1/loops unless enabled is true

Issue #73 closed
Myles Metzler created an issue

The following should set both temperature and humidity to 45, it does not

import requests, json

uri = 'http://10.30.200.254/api/v1.0/chambers/1/loops'
print 'GET Response:'
print json.dumps(requests.get(uri).json(), sort_keys=True, indent=4)

data = [{'setValue':45,'controller':1,'N':1}, {'setValue':45,'controller':1,'N':2}]
headers = {'Content-type': 'application/json'}
print '\n\nPOST Response:'
print json.dumps(requests.post(uri, data=json.dumps(data), headers=headers).json(), sort_keys=True, indent=4)

however adding "enable":true is a work around:

import requests, json

uri = 'http://10.30.200.254/api/v1.0/chambers/1/loops'
print 'GET Response:'
print json.dumps(requests.get(uri).json(), sort_keys=True, indent=4)

data = [{'setValue':45,'enable':True,'controller':1,'N':1}, {'setValue':45,'enable':True,'controller':1,'N':2}]
headers = {'Content-type': 'application/json'}
print '\n\nPOST Response:'
print json.dumps(requests.post(uri, data=json.dumps(data), headers=headers).json(), sort_keys=True, indent=4)

Comments (5)

  1. Log in to comment