diff --git a/cosmfetcher.js b/cosmfetcher.js index e5730b3..6db581e 100644 --- a/cosmfetcher.js +++ b/cosmfetcher.js @@ -5,7 +5,7 @@ var assert = require('assert'), var hubAddress = '192.168.23.43', hubPort = 7110; var oscClient = new osc.Client(hubAddress, hubPort); -var streams = [ 91755, 70632, 53146, 45582 ]; +var streams = [ 91755, 70632, 53146, 45582, 64590 ]; var client = restify.createJsonClient({ url: 'http://api.cosm.com', headers: {'X-ApiKey':'orKBBdLAKuKJU-RxqmZpZB6q0baSAKxBTVhKdjhUNkdyVT0g'},version:'*' @@ -21,7 +21,7 @@ var getstream = function(streamId) { var dataStream = obj.datastreams[i]; if(dataStream.id != null) { var streamName = dataStream.id; - if(streamName.length < 2 && dataStream.tags.length > 0) streamName = dataStream.tags[0] + streamName; + if(streamName.length < 2 && dataStream.tags != null) streamName = dataStream.tags[0] + streamName; var address = '/cosm/' + obj.id + "/" + streamName; var currentValue = dataStream.current_value; @@ -31,6 +31,7 @@ var getstream = function(streamId) { if(recentvalues[address] != currentValue) { oscClient.send(address, currentValue); + console.log(address + ": " + currentValue); } recentvalues[address] = currentValue;