 				'qs' : vars
 				'url' : "http://#{host}/config/xmlapi/#{script}.cgi"
 				'withCredentials' : false
+				'scheme' : 'http' #a bug in browserify?
 
 parseXml = (xml) ->
 	xml2js.parseStringAsync xml

							'value' : dp.$.value #todo: type according to valuetype
							'set' : (newValue) ->
								module.exports.setState @ccu,@id,newValue
			return res

		'new_value': value
								 })

module.exports.getState = (addr,id) ->
	rq urlOf(addr,'state', {
		'datapoint_id' : id
		})
	.then parseXml
	.then (res) ->
		if not res.state.datapoint? || res.state.datapoint.length == 0
			throw 'empty resp'
		res.state.datapoint[0].$.value


module.exports.getDataPoints = (addr) ->
	res = []
	idx=0
