Merge pull request #310 from snowdd1/master

Fix vindex variable scope for address registration
This commit is contained in:
Nick Farina
2015-10-23 06:50:22 -07:00

View File

@@ -3,19 +3,18 @@
*/ */
'use strict'; 'use strict';
var types = require("hap-nodejs/accessories/types.js"); var types = require("hap-nodejs/accessories/types.js");
//var hardware = require('myHardwareSupport'); //require any additional hardware packages
var knxd = require('eibd'); var knxd = require('eibd');
function KNXPlatform(log, config){ function KNXPlatform(log, config){
this.log = log; this.log = log;
this.config = config; this.config = config;
// this.property1 = config.property1;
// this.property2 = config.property2;
// initiate connection to bus for listening ==> done with first shim // initiate connection to bus for listening ==> done with first shim
}; }
KNXPlatform.prototype = { KNXPlatform.prototype = {
accessories: function(callback) { accessories: function(callback) {
@@ -49,10 +48,10 @@ KNXPlatform.prototype = {
break; break;
default: default:
// do something else // do something else
this.log("unkown accessory type found") this.log("unkown accessory type found");
} }
}; }
// if done, return the array to callback function // if done, return the array to callback function
this.log("returning "+myAccessories.length+" accessories"); this.log("returning "+myAccessories.length+" accessories");
callback(myAccessories); callback(myAccessories);
@@ -118,7 +117,7 @@ function groupsocketlisten(opts, callback) {
var registerSingleGA = function registerSingleGA (groupAddress, callback, reverse) { var registerSingleGA = function registerSingleGA (groupAddress, callback, reverse) {
subscriptions.push({address: groupAddress, callback: callback, reverse:reverse }); subscriptions.push({address: groupAddress, callback: callback, reverse:reverse });
} };
/* /*
* public busMonitor.startMonitor() * public busMonitor.startMonitor()
@@ -193,7 +192,7 @@ var registerGA = function (groupAddresses, callback) {
} else { } else {
// it's only one // it's only one
if (groupAddresses.match(/(\d*\/\d*\/\d*)/)) { if (groupAddresses.match(/(\d*\/\d*\/\d*)/)) {
registerSingleGA (groupAddresses.match(/(\d*\/\d*\/\d*)/)[0], callback, groupAddresses[i].match(/\d*\/\d*\/\d*(R)/) ? true:false); registerSingleGA (groupAddresses.match(/(\d*\/\d*\/\d*)/)[0], callback, groupAddresses.match(/\d*\/\d*\/\d*(R)/) ? true:false);
} }
} }
// console.log("listeners now: " + subscriptions.length); // console.log("listeners now: " + subscriptions.length);