diff --git a/config.schema.json b/config.schema.json index d4c9754..f135374 100644 --- a/config.schema.json +++ b/config.schema.json @@ -15,6 +15,13 @@ "minlength": 1, "required": true }, + "lc7001-password": { + "title": "Password", + "type": "string", + "default": "", + "description": "Password assigned to LC7001 via the Legrand Lighting Control app. (Pre-2020 configurations may not have a password.)", + "required": false + }, "lc7001-hostname": { "title": "Hostname", "type": "string", @@ -112,6 +119,7 @@ }, "form": [ "name", + "lc7001-password", "lc7001-hostname", { "key": "lc7001-port", diff --git a/lib/lc7001.d.ts b/lib/lc7001.d.ts index 5fd0f8c..740a691 100644 --- a/lib/lc7001.d.ts +++ b/lib/lc7001.d.ts @@ -10,6 +10,8 @@ export declare class LC7001 { private interface; private readonly tcpOptions; private _commandID; + private passwordHash; + private isAuthenticated; private readonly delimiter; private tcpBuffer; private commandQueue; @@ -55,7 +57,8 @@ export declare class LC7001 { private lastPingSeq; private lastPingTime; private lastSysPropTime; - constructor(platform: PlatformLC7001, tcpOptions: TcpSocketConnectOpts, delimiter?: string); + constructor(platform: PlatformLC7001, password: string | undefined, tcpOptions: TcpSocketConnectOpts, delimiter?: string); + private answerChallenge; private checkInitialized; private get commandID(); private cmdGetAccessory; diff --git a/lib/lc7001.d.ts.map b/lib/lc7001.d.ts.map index a5fa997..fea16c2 100644 --- a/lib/lc7001.d.ts.map +++ b/lib/lc7001.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lc7001.d.ts","sourceRoot":"","sources":["../src/lc7001.ts"],"names":[],"mappings":";AACA,OAAO,EACH,YAAY,EACf,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAEH,oBAAoB,EACvB,MAAM,KAAK,CAAC;AAEb,OAAO,EACH,cAAc,EACjB,MAAM,YAAY,CAAC;AAEpB,qBAAa,MAAM;aAkEK,QAAQ,EAAE,cAAc;IAhErC,WAAW,EAAkB,GAAG,EAAE,CAAM;IACxC,aAAa,EAAgB,OAAO,CAAS;IAG7C,OAAO,EAAsB,YAAY,CAAC;IACjD,OAA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D,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,qBAAqB,CAAuB;IACpD,OAAO,CAAC,oBAAoB,CAAwB;IACpD,OAAO,CAAC,QAAQ,CAAoC;IACpD,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,QAAQ,CAA+B;IAM/C,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,YAAY,CAAgC;IACpD,OAAO,CAAC,eAAe,CAA6B;gBAGhC,QAAQ,EAAE,cAAc,EACxC,QAAQ,oBAAa,EACrB,UAAU,EAAC,oBAAoB,EAC/B,SAAS,GAAE,MAAa;IAsD5B,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,gBAAgB;IAaxB,OAAO,KAAK,SAAS,GAOpB;IAED,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,sBAAsB;IASjC,OAAO,CAAC,gBAAgB;IASrB,OAAO,CAAC,kBAAkB;IAS7B,OAAO,CAAC,eAAe;IAWpB,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,iBAAiB;IAyBzB,OAAO,CAAC,aAAa;IAgFrB,OAAO,CAAC,oBAAoB;IAmD5B,OAAO,CAAC,oBAAoB;IA6N5B,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,OAAO;IAYf,OAAO,CAAC,YAAY;IAiBb,YAAY,CAAC,EAAE,EAAC,MAAM,EAAC,YAAY,EAAC,GAAG,GAAG,IAAI;IAK9C,eAAe,IAAI,IAAI;CAKjC"} \ No newline at end of file diff --git a/lib/lc7001.js b/lib/lc7001.js index 51849b6..44e2740 100644 --- a/lib/lc7001.js +++ b/lib/lc7001.js @@ -1,11 +1,14 @@ "use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.LC7001 = void 0; -//LC7001 module will emit events when it initializes or an accessory is updated. +const crypto_1 = __importDefault(require("crypto")); const events_1 = require("events"); const net_1 = require("net"); class LC7001 { - constructor(platform, tcpOptions, delimiter = '\0') { + constructor(platform, password = '', tcpOptions, delimiter = '\0') { this.platform = platform; //Interface to platform this.accessories = []; @@ -61,6 +64,10 @@ class LC7001 { this.lastPingSeq = undefined; this.lastPingTime = undefined; this.lastSysPropTime = undefined; + var passwordHasher = crypto_1.default.createHash('MD5'); + passwordHasher.update(password); + this.passwordHash = passwordHasher.digest(); + this.isAuthenticated = false; this.tcpOptions = tcpOptions; this.delimiter = delimiter; this.emitter = new events_1.EventEmitter; @@ -74,6 +81,7 @@ class LC7001 { this.platform.log.debug('-->Local TCP Port: ', this.interface.localPort); }); this.interface.on('close', (hadError) => { + this.tcpBuffer = ''; if (hadError) { this.platform.log.error('Connection to LC7001 closed due to error. Waiting 30 seconds to reconnect....'); setTimeout(this.connectLC7001.bind(this), 30000); @@ -97,7 +105,8 @@ class LC7001 { }); this.interface.on('ready', () => { this.platform.log.debug('Connection to LC7001 ready for use.'); - this.sendCMDArray([this.cmdGetSystemInfo(), this.cmdGetLC7001Properties(), this.cmdListAccessories()]); + //Previously, before authentication requirement, this is where commands began issuing. Moved to 'data' emitter. + //this.sendCMDArray([this.cmdGetSystemInfo(),this.cmdGetLC7001Properties(),this.cmdListAccessories()]); }); this.interface.on('timeout', () => { this.platform.log.warn('Connection to LC7001 has been inactive for 30 seconds. Destroying connection....'); @@ -105,6 +114,17 @@ class LC7001 { }); this.connectLC7001(); } + answerChallenge(challenge) { + var answer; + var answerCipher = crypto_1.default.createCipheriv('AES-128-ECB', this.passwordHash, null); + this.platform.log.debug('Generating challenge answer....'); + this.platform.log.debug('Using challenge:', challenge.toString('hex').toUpperCase()); + //this.platform.log.debug('Using password hash:',this.passwordHash.toString('hex').toUpperCase()); + answer = answerCipher.update(challenge).toString('hex').toUpperCase(); + this.platform.log.debug('Answer generated:', answer); + this.platform.log.debug('Sending answer to LC7001....'); + this.interface.write(answer, 'ascii'); + } checkInitialized() { this.platform.log.debug('Testing to see if LC7001 interface is initialized....'); this.isInitialized = this.isInitializedTest(); @@ -211,74 +231,92 @@ class LC7001 { return testcase; } processBuffer(data) { - var testJSON; this.platform.log.debug('Processing data received from LC7001....'); this.platform.log.debug('Starting buffer:', JSON.stringify(this.tcpBuffer)); this.platform.log.debug('Data received:', JSON.stringify(data)); this.platform.log.debug('Delimiter:', JSON.stringify(this.delimiter)); var splitBuffer = data.split(this.delimiter); + splitBuffer[0] = this.tcpBuffer + splitBuffer[0]; + this.tcpBuffer = ''; this.platform.log.debug('Segments received:', splitBuffer.length); splitBuffer.forEach((value, index) => { this.platform.log.debug('-->', (index + 1), ':', JSON.stringify(value)); }); - try { - testJSON = JSON.parse(splitBuffer[0]); - } - catch (_a) { - this.platform.log.debug('First segment is not good JSON.... Prepending buffer.'); - splitBuffer[0] = this.tcpBuffer + splitBuffer[0]; - } - this.tcpBuffer = splitBuffer.pop(); - this.platform.log.debug('Processed segments:', splitBuffer.length); - splitBuffer.forEach((value, index) => { - this.platform.log.debug('-->', (index + 1), ':', JSON.stringify(value)); - }); - this.platform.log.debug('Ending buffer:', JSON.stringify(this.tcpBuffer)); if (splitBuffer.length > 0) { - this.platform.log.debug('Adding JSON to Receive Queue....'); splitBuffer.forEach((value, index) => { - try { - this.responseQueue.push(JSON.parse(value)); + this.platform.log.debug('Processing segment:', (index + 1)); + if (value.length == 0) { + this.platform.log.debug('Segment has length 0; skipping.'); } - catch (_a) { - if (value.indexOf('}{') >= 0) { - this.platform.log.warn('Error parsing JSON. Possible undelimited JSON detected. Replacing all }{s with delimited version.'); - var splitvalue = value.replace(/\}\{/g, ('}' + this.delimiter + '{')).split(this.delimiter); - this.platform.log.debug('Salvaged segments:', splitvalue.length); - splitvalue.forEach((value2, index2) => { - this.platform.log.debug('-->', (index2 + 1), ':', JSON.stringify(value2)); - }); - splitvalue.forEach((value2, index2) => { - try { - this.responseQueue.push(JSON.parse(value2)); - this.platform.log.info('Succcesfully salvaged JSON.'); + else { + this.platform.log.debug('Checking if segment is good JSON....'); + try { + this.responseQueue.push(JSON.parse(value)); + this.platform.log.debug('Segment is good JSON. Added JSON to Receive Queue.'); + if (!this.isAuthenticated) { + this.platform.log.debug('LC7001 must not require authentication. Initializing LC7001....'); + this.isAuthenticated = true; + this.sendCMDArray([this.cmdGetSystemInfo(), this.cmdGetLC7001Properties(), this.cmdListAccessories()]); + } + } + catch (_a) { + this.platform.log.debug('Segment is not good JSON. Checking if segment is an authentication message....'); + if (/^Hello V1 /.test(value)) { + this.platform.log.debug('Segment is an authentication message. This LC7001 requires authentication.'); + this.isAuthenticated = false; + } + else if (/^[0-9A-F]{32} [0-9A-F]{12}/.test(value)) { + this.platform.log.debug('LC7001 has sent an authentication challenge.'); + this.answerChallenge(Buffer.from(value.substr(0, 32), 'hex')); + } + else if (/^\[SETKEY\]/.test(value)) { + this.platform.log.warn('Your LC7001 requires a password be configured. Please set the password using the Legrand Lighting Control app and add the password to configuration.'); + this.platform.log.warn('This plugin will not work until a password is set on the LC7001 and entered into the configuration.'); + } + else if (/^\[OK\]/.test(value)) { + this.platform.log.info('Successfully authenticated to LC7001. Initializing LC7001....'); + this.isAuthenticated = true; + this.sendCMDArray([this.cmdGetSystemInfo(), this.cmdGetLC7001Properties(), this.cmdListAccessories()]); + } + else if (/^\[INVALID\]/.test(value)) { + this.platform.log.error('Failed to authenticate to LC7001; check the password. LC7001 will disconnect.'); + } + else { + this.platform.log.debug('Segment is not an authentication message. Checking for undelimited JSON....'); + if (value.indexOf('}{') >= 0) { + this.platform.log.warn('Possible undelimited JSON detected. Replacing all }{s with delimited version.'); + var splitValue = value.replace(/\}\{/g, ('}' + this.delimiter + '{')).split(this.delimiter); + this.platform.log.debug('Salvaged segments:', splitValue.length); + splitValue.forEach((value2, index2) => { + this.platform.log.debug('-->', (index2 + 1), ':', JSON.stringify(value2)); + }); + splitValue.forEach((value2, index2) => { + try { + this.responseQueue.push(JSON.parse(value2)); + this.platform.log.info('Succcesfully salvaged JSON. Added JSON to Receive Queue.'); + } + catch (err) { + this.platform.log.error('Unable to parse segment:', value2); + this.platform.log.debug('Salvaged segment', (index2 + 1), 'is not good JSON.'); + this.platform.log.debug('Skipping....'); + } + }); } - catch (err) { - this.platform.log.error('Unable to parse JSON:\n', value2); - this.platform.log.debug('Salvaged segment', (index2 + 1), 'is not good JSON.'); - this.platform.log.debug('Skipping....'); + else { + if (index = splitBuffer.length - 1) { + this.platform.log.debug('Unable to parse last segment; saving in buffer.'); + this.tcpBuffer = value; + } + else { + this.platform.log.error('Unable to parse segment:', value); + this.platform.log.debug('Skipping....'); + } } - }); - } - else { - this.platform.log.error('Unable to parse JSON:\n', value); - this.platform.log.debug('Segment', (index + 1), 'is not good JSON.'); - this.platform.log.debug('Skipping....'); + } } } }); } - if (this.tcpBuffer.length > 0) { - this.platform.log.debug('Testing ending buffer for good JSON....'); - try { - this.responseQueue.push(JSON.parse(this.tcpBuffer)); - this.platform.log.debug('Buffer is good JSON. Pushed to Receive Queue and clearing buffer.'); - this.tcpBuffer = ''; - } - catch (_b) { - this.platform.log.debug('Buffer is not good JSON. Holding buffer.'); - } - } this.processresponseQueue(); } processresponseQueue() { diff --git a/lib/lc7001.js.map b/lib/lc7001.js.map index 9d20bb3..e6dd9ff 100644 --- a/lib/lc7001.js.map +++ b/lib/lc7001.js.map @@ -1 +1 @@ -{"version":3,"file":"lc7001.js","sourceRoot":"","sources":["../src/lc7001.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,mCAEgB;AAEhB,6BAGa;AAMb,MAAa,MAAM;IAiEf,YACoB,QAAwB,EACxC,UAA+B,EAC/B,YAAoB,IAAI;QAFR,aAAQ,GAAR,QAAQ,CAAgB;QAjE5C,uBAAuB;QAChB,gBAAW,GAA0B,EAAE,CAAC;QACxC,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b/lib/platform.d.ts @@ -16,6 +16,7 @@ export declare class PlatformLC7001 implements DynamicPlatformPlugin { readonly logEliotErrors: boolean; private readonly useOldUUID; private lc7001; + private readonly password; private readonly tcpOptions; private readonly jsonDelimiter; constructor(log: Logger, config: PlatformConfig, api: API); diff --git a/lib/platform.d.ts.map b/lib/platform.d.ts.map index 9910345..7e00180 100644 --- a/lib/platform.d.ts.map +++ b/lib/platform.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,GAAG,EACH,qBAAqB,EACrB,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,cAAc,EAIf,MAAM,YAAY,CAAC;AAWpB,UAAU,mBAAoB,SAAQ,iBAAiB;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,cAAe,YAAW,qBAAqB;aAwBxC,GAAG,EAAK,MAAM;aACd,MAAM,EAAE,cAAc;aACtB,GAAG,EAAK,GAAG;IAxB7B,SAAgB,OAAO,EAAE,OAAiB,OAAO,CAAwB;IACzE,SAAgB,cAAc,EAAE,OAAU,cAAc,CAA+B;IAEvF,SAAgB,WAAW,EAAe,mBAAmB,EAAE,CAAM;IAGrE,OAAO,CAAC,aAAa,CAAqC;IAG1D,SAAgB,uBAAuB,EAAG,OAAO,CAAS;IAC1D,SAAgB,kBAAkB,EAAQ,OAAO,CAAS;IAC1D,SAAgB,gBAAgB,EAAU,OAAO,CAAS;IAC1D,SAAgB,cAAc,EAAY,OAAO,CAAS;IAC1D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAG1D,OAAO,CAAC,MAAM,CAAmC;IACjD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoE;IAC/F,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0B;gBAItC,GAAG,EAAK,MAAM,EACd,MAAM,EAAE,cAAc,EACtB,GAAG,EAAK,GAAG;IAiG7B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C,wBAAwB;IAuDhC,OAAO,CAAC,yBAAyB;IAiD1B,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;CA6CzD"} \ No newline at end of file diff --git a/lib/platform.js b/lib/platform.js index b4d9984..ffee569 100644 --- a/lib/platform.js +++ b/lib/platform.js @@ -21,14 +21,23 @@ class PlatformLC7001 { this.logDebugMessages = false; this.logEliotErrors = false; this.useOldUUID = false; + this.password = ''; this.tcpOptions = { host: 'LCM1.local', port: 2112 }; this.jsonDelimiter = '\0'; this.log.info('Platform initializing....'); this.log.debug('Parsing platform configuration:'); for (var propertyNameConfig in this.config) { - this.log.debug("-->", propertyNameConfig, ":", this.config[propertyNameConfig]); + if (propertyNameConfig == 'lc7001-password') { + this.log.debug('-->', propertyNameConfig, ': ********'); + } + else { + this.log.debug('-->', propertyNameConfig, ':', this.config[propertyNameConfig]); + } } ; + if ('lc7001-password' in this.config) { + this.password = this.config['lc7001-password']; + } if ('lc7001-hostname' in this.config) { this.tcpOptions.host = this.config['lc7001-hostname']; } @@ -80,7 +89,7 @@ class PlatformLC7001 { this.log.debug('Delimiter:', JSON.stringify(this.jsonDelimiter)); } this.log.debug('Creating LC7001 interface....'); - this.lc7001 = new lc7001_1.LC7001(this, this.tcpOptions, this.jsonDelimiter); + this.lc7001 = new lc7001_1.LC7001(this, this.password, this.tcpOptions, this.jsonDelimiter); this.log.debug('LC7001 interface created.'); this.lc7001.emitter.on('initialized', () => { this.log.debug('Received "initialized" event from LC7001 module.'); @@ -284,7 +293,7 @@ class PlatformLC7001 { this.log.info('Configuring accessory:', accessory.displayName); this.log.debug('Adding listener for "identify" event.'); accessory.on('identify', () => { - this.log.info('Accessory', accessory.displayName, "identified."); + this.log.info('Accessory', accessory.displayName, 'identified.'); }); if (accessory.getService(this.api.hap.Service.Lightbulb) !== undefined) { if (accessory.getService(this.api.hap.Service.Lightbulb).testCharacteristic(this.api.hap.Characteristic.On)) { diff --git a/lib/platform.js.map b/lib/platform.js.map index 07a0559..22adf8d 100644 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AAC,KAA0B,EAAC,QAAmC,EAAE,EAAE;oBAC1L,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,6DAA6D,EAAC,SAAS,CAAC,WAAW,EAAC,KAAK,EAAC,KAAK,CAAC,CAAC;oBAChH,IAAI,SAAS,CAAC,WAAW,KAAK,SAAS,EAAE;wBACvC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;qBAC5F;yBAAM;wBACL,IAAI,YAAY,GAAO,EAAE,CAAC;wBAC1B,YAAY,CAAC,UAAU,GAAG,KAAK,CAAC;wBAChC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,WAAW,EAAC,YAAY,CAAC,CAAC;qBAC9D;oBACD,QAAQ,EAAE,CAAC;gBACb,CAAC,CAAC,CAAC;aACJ;SACF;QACD,IAAI,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC1D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAC,SAAS,CAAC,WAAW,EAAC,sBAAsB,EAAC,cAAc,CAAC,CAAC;QACxF,IAAI,SAAS,CAAC,WAAW,KAAK,SAAS,EAAE;YACvC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,EAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,WAAW,EAAC,wCAAwC,EAAC,cAAc,CAAC,CAAC;YACnI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,sBAAsB,GAAG,cAAc,CAAC;YACvF,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;SAClE;IACH,CAAC;CAEF;AA5UD,wCA4UC"} \ No newline at end of file diff --git a/package.json b/package.json index 7497aad..dbe1dbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-lc7001", - "version": "1.0.4", + "version": "1.1.1", "description": "Homebridge plugin to communicate with Legrand LC7001. (RFLC, Adorne, and On-Q)", "keywords": [ "homebridge-plugin", @@ -35,6 +35,6 @@ "typescript": "^4.0.2" }, "engines": { - "node": ">=0.12.0" + "node": ">=10.17.0" } } diff --git a/src/lc7001.ts b/src/lc7001.ts index 769027a..8d428d1 100644 --- a/src/lc7001.ts +++ b/src/lc7001.ts @@ -1,637 +1,672 @@ -//LC7001 module will emit events when it initializes or an accessory is updated. -import { - EventEmitter -} from 'events'; - -import { - Socket, - TcpSocketConnectOpts -} from 'net'; - -import { - PlatformLC7001 -} from './platform'; - -export class LC7001 { - //Interface to platform - public accessories: any[] = []; - public isInitialized: boolean = false; - - //Node.js objects - public emitter: EventEmitter; - private interface: Socket; - private readonly tcpOptions: TcpSocketConnectOpts; - - //Private properties - private _commandID: number = 0; - private readonly delimiter: string; - private tcpBuffer: string = ''; - private commandQueue: any[] = []; - private responseQueue: any[] = []; - - //LC7001-supplied properties - private addALight: any = false; - private addASceneController: any = false; - private authExempt: any = undefined; - private configured: any = undefined; - private connectionSequenceNumber: any = undefined; - private daylightSavingtime: any = undefined; - private effectiveTimeZone: any = undefined; - private firmwareBranch: any = undefined; - private firmwareDate: any = undefined; - private firmwareVersion: any = undefined; - private firstSystemTime: any = undefined; - private firstTimeRecorded: any = undefined; - private freeMemory: any = undefined; - private freeMemLowWater: any = undefined; - private free_Count: any = undefined; - private houseID: any = undefined; - private jsonConnections: any = undefined; - private jsonErr: any = undefined; - private location: any = undefined; - private locationInfo: any = undefined; - private mac: any = undefined; - public macAddress: any = undefined; - private malloc_Count: any = undefined; - private mobileAppData: any = undefined; - private model: any = undefined; - private otherRecvErr: any = undefined; - private peakRamUsage: any = undefined; - private qmotionTryFind: any = undefined; - private shortMACAddress: any = undefined; - private staticRamUsage: any = undefined; - private supportsSceneFadeRate: any = undefined; - private taskHeartbeatBitmask: any = undefined; - private timeZone: any = undefined; - private updateState: any = undefined; - private zoneList: any[] = []; - //Depricated properties - //private samsungUserToken: any = undefined; - //private samsungRefreshToken: any = undefined; - - //LC7001-derived properties - private lastDiagTime: any = undefined; - private lastMemTime: any = undefined; - private lastNTPTime: any = undefined; - private lastPingSeq: any = undefined; - private lastPingTime: any = undefined; - private lastSysPropTime: any = undefined; - - constructor( - public readonly platform: PlatformLC7001, - tcpOptions:TcpSocketConnectOpts, - delimiter: string = '\0' - ) { - this.tcpOptions = tcpOptions; - this.delimiter = delimiter; - - this.emitter = new EventEmitter; - this.interface = new Socket(); - this.interface.on('connect',() => { - this.platform.log.info('Connection to LC7001 established.'); - this.platform.log.debug('-->IP Version: ',this.interface.remoteFamily); - this.platform.log.debug('-->IP Address: ',this.interface.remoteAddress); - this.platform.log.debug('-->TCP Port: ',this.interface.remotePort); - this.platform.log.debug('-->Local IP Address:',this.interface.localAddress); - this.platform.log.debug('-->Local TCP Port: ',this.interface.localPort); - }); - this.interface.on('close',(hadError) => { - if (hadError) { - this.platform.log.error('Connection to LC7001 closed due to error. Waiting 30 seconds to reconnect....'); - setTimeout(this.connectLC7001.bind(this),30000); - } else { - this.platform.log.info('Connection to LC7001 closed. Reconnecting....'); - this.connectLC7001(); - } - }); - this.interface.on('data',(data: string) => { - this.platform.log.debug('Data received from LC7001 (stringified):',JSON.stringify(data)); - if (data.length <= 0) { - this.platform.log.debug('Length of data is zero! Nothing to do.') - } else { - this.processBuffer(data); - } - }); - this.interface.on('error',(err) => { - this.platform.log.error('Error on LC7001 connection:',err.toString()); - }); - this.interface.on('ready',() => { - this.platform.log.debug('Connection to LC7001 ready for use.') - this.sendCMDArray([this.cmdGetSystemInfo(),this.cmdGetLC7001Properties(),this.cmdListAccessories()]); - }); - this.interface.on('timeout',() => { - this.platform.log.warn('Connection to LC7001 has been inactive for 30 seconds. Destroying connection....'); - this.interface.destroy(); - }); - - this.connectLC7001(); - } - - private checkInitialized(): void { - this.platform.log.debug('Testing to see if LC7001 interface is initialized....'); - this.isInitialized = this.isInitializedTest(); - if (this.isInitialized) { - this.platform.log.debug('LC7001 interface is initialized. Emitting "initialized" event....'); - this.emitter.emit('initialized'); - } else { - this.platform.log.debug('LC7001 interface is not initialized.') - } - - } - - //LC7001 sends a response with the name ID as the command. We utilize an ID field that is inrecemented every time it is requested to serialize commands. - private get commandID(): number { - if (this._commandID >= Number.MAX_SAFE_INTEGER) { - this._commandID = 1; - } else { - this._commandID = this._commandID + 1; - } - return this._commandID; - } - - private cmdGetAccessory(id: number): object { - var cmd: any = {}; - this.platform.log.debug('Building ReportZoneProperties command....') - cmd.ID = this.commandID; - cmd.Service = 'ReportZoneProperties'; - cmd.ZID = id; - this.platform.log.debug('Command:',cmd) - return cmd; - } - - private cmdGetLC7001Properties(): object { - var cmd:any = {}; - this.platform.log.debug('Building ReportSystemProperties command....') - cmd.ID = this.commandID; - cmd.Service = 'ReportSystemProperties'; - this.platform.log.debug('Command:',cmd) - return cmd; - } - - private cmdGetSystemInfo(): object { - var cmd:any = {}; - this.platform.log.debug('Building SystemInfo command....') - cmd.ID = this.commandID; - cmd.Service = 'SystemInfo'; - this.platform.log.debug('Command:',cmd) - return cmd; - } - - private cmdListAccessories(): object { - var cmd:any = {}; - this.platform.log.debug('Building ListZones command....') - cmd.ID = this.commandID; - cmd.Service = 'ListZones'; - this.platform.log.debug('Command:',cmd) - return cmd; - } - - private cmdSetAccessory(id: number,PropertyList:any) { - var cmd:any = {}; - this.platform.log.debug('Building SetZoneProperties command....') - cmd.ID = this.commandID; - cmd.Service = 'SetZoneProperties'; - cmd.ZID = id; - cmd.PropertyList = PropertyList; - this.platform.log.debug('Command:',cmd) - return cmd; - } - - private connectLC7001(): void { - this.platform.log.info('Connecting to LC7001....'); - this.platform.log.debug('TCP Options:'); - this.platform.log.debug('--> host:',this.tcpOptions.host); - this.platform.log.debug('--> port:',this.tcpOptions.port); - this.platform.log.debug('--> localAddress:',this.tcpOptions.localAddress); - this.platform.log.debug('--> localPort:',this.tcpOptions.localPort); - this.platform.log.debug('--> family:',this.tcpOptions.family); - this.interface.connect(this.tcpOptions,() => { - this.interface.setEncoding('ascii'); - this.interface.setTimeout(30000); - }); - } - - //LC7001 is initialized when zone list is populated and properties from each zone have been queried. - //If the LC7001 has no zones, it will never be initialized. - private isInitializedTest(): boolean { - var testcase:boolean = true; - - if (this.zoneList.length == 0) { - this.platform.log.debug('Zone list is empty: Fail'); - testcase = false; - } else { - this.platform.log.debug('Zone list is populated: Pass'); - if (this.accessories.length == 0) { - this.platform.log.debug('Accessories list is empty: Fail'); - testcase = false; - } else { - this.zoneList.forEach((value) => { - if (this.accessories[value.ZID] === undefined) { - this.platform.log.debug('Zone',value.ZID,'is missing from accessories list: Fail') - testcase = false; - } else { - this.platform.log.debug('Found zone',value.ZID,'on accessories list: Pass') - } - }); - } - } - return testcase; - } - - private processBuffer(data: string): void { - var testJSON: any; - - this.platform.log.debug('Processing data received from LC7001....'); - this.platform.log.debug('Starting buffer:',JSON.stringify(this.tcpBuffer)); - this.platform.log.debug('Data received:',JSON.stringify(data)); - this.platform.log.debug('Delimiter:',JSON.stringify(this.delimiter)); - var splitBuffer = data.split(this.delimiter); - this.platform.log.debug('Segments received:',splitBuffer.length); - splitBuffer.forEach((value,index) => { - this.platform.log.debug('-->',(index + 1),':',JSON.stringify(value)); - }); - try { - testJSON = JSON.parse(splitBuffer[0]); - } catch { - this.platform.log.debug('First segment is not good JSON.... Prepending buffer.'); - splitBuffer[0] = this.tcpBuffer + splitBuffer[0]; - } - this.tcpBuffer = splitBuffer.pop()!; - this.platform.log.debug('Processed segments:',splitBuffer.length); - splitBuffer.forEach((value,index) => { - this.platform.log.debug('-->',(index + 1),':',JSON.stringify(value)); - }); - this.platform.log.debug('Ending buffer:',JSON.stringify(this.tcpBuffer)); - if (splitBuffer.length > 0) { - this.platform.log.debug('Adding JSON to Receive Queue....'); - splitBuffer.forEach((value,index) => { - try { - this.responseQueue.push(JSON.parse(value)); - } catch { - if (value.indexOf('}{') >= 0) { - this.platform.log.warn('Error parsing JSON. Possible undelimited JSON detected. Replacing all }{s with delimited version.'); - var splitvalue = value.replace(/\}\{/g, ('}' + this.delimiter + '{')).split(this.delimiter); - this.platform.log.debug('Salvaged segments:',splitvalue.length); - splitvalue.forEach((value2,index2) => { - this.platform.log.debug('-->',(index2 + 1),':',JSON.stringify(value2)); - }); - splitvalue.forEach((value2,index2) => { - try { - this.responseQueue.push(JSON.parse(value2)); - this.platform.log.info('Succcesfully salvaged JSON.'); - } catch(err) { - this.platform.log.error('Unable to parse JSON:\n',value2); - this.platform.log.debug('Salvaged segment',(index2 + 1),'is not good JSON.'); - this.platform.log.debug('Skipping....'); - } - }); - } else { - this.platform.log.error('Unable to parse JSON:\n',value); - this.platform.log.debug('Segment',(index + 1),'is not good JSON.'); - this.platform.log.debug('Skipping....'); - } - } - }); - } - if (this.tcpBuffer.length > 0) { - this.platform.log.debug('Testing ending buffer for good JSON....'); - try { - this.responseQueue.push(JSON.parse(this.tcpBuffer)); - this.platform.log.debug('Buffer is good JSON. Pushed to Receive Queue and clearing buffer.'); - this.tcpBuffer = ''; - } catch { - this.platform.log.debug('Buffer is not good JSON. Holding buffer.') - } - } - this.processresponseQueue(); - } - - private processresponseQueue(): void { - var message: any = {}; - var postProcessing: boolean[]; - var runCheckInitialized: boolean = false; - var runScanAccessories: boolean = false; - - this.platform.log.debug('Processing Receive Queue....'); - this.platform.log.debug('Receive Queue length:',this.responseQueue.length); - if (this.responseQueue.length == 0) { - this.platform.log.debug('Receive Queue empty; nothing to do.') - } else { - this.platform.log.debug('Receive Queue contents:') - this.responseQueue.forEach((value,index) => { - this.platform.log.debug('-->',(index + 1),':',JSON.stringify(value)) - },this); - while (this.responseQueue.length > 0) { - message = this.responseQueue.shift(); - if ('ID' in message && message.ID > 0) { - this.platform.log.debug('Message contains non-zero ID. Checking Command Queue for matching command....') - this.commandQueue.forEach((value,index,array) => { - if (value.ID == message.ID) { - this.platform.log.debug('Found matching command:',value); - this.platform.log.debug('Removing command from Command Queue.'); - array.splice(index,1); - } - }); - } - postProcessing = this.processLC7001Message(message); - if (postProcessing[0]) { - runCheckInitialized = true; - } - if (postProcessing[1]) { - this.isInitialized = false; - runCheckInitialized = true; - } - } - if (!runCheckInitialized && !runScanAccessories) { - this.platform.log.debug('Response Queue empty. No post-processing requested.'); - } else { - this.platform.log.debug('Response Queue empty. Running post-processing....'); - if (runCheckInitialized) { - this.platform.log.debug('Initialization check requested.'); - this.checkInitialized(); - } - if (runScanAccessories) { - this.platform.log.debug('Accessory scan requested.'); - } - } - } - } - - private processLC7001Message(message: any): boolean[] { - var checkInitializedWhenDone: boolean = false; - var rescanAccessoriesWhenDone: boolean = false; - this.platform.log.debug('Processing message:',JSON.stringify(message)); - if ('ID' in message) { - if ('Service' in message) { - switch(message.Service) { - case 'BroadcastDiagnostics': - this.platform.log.debug('Message type: BroadcastDiagnostics'); - this.firmwareVersion = message.FirmwareVersion; - this.firstSystemTime = message.firstSystemTime; - this.shortMACAddress = message.MACAddress; - this.connectionSequenceNumber = message.connectionSequenceNum; - this.firstTimeRecorded = message.FirstTimeRecorded; - this.authExempt = message.AuthExempt; - this.otherRecvErr = message.other_recv_err; - this.jsonErr = message.json_err; - this.qmotionTryFind = message.qmotion_try_find; - this.taskHeartbeatBitmask = message.task_heartbeat_bitmask; - this.lastDiagTime = message.CurrentTime; - if (this.platform.logBroadcastDiagnostics) { - this.platform.log.info('LC7001 BroadcastDiagnostices message:\n',message); - } - break; - case 'BroadcastMemory': - this.platform.log.debug('Message type: BroadcastMemory'); - this.freeMemory = message.FreeMemory; - this.freeMemLowWater = message.FreeMemLowWater; - this.malloc_Count = message.Malloc_Count; - this.free_Count = message.Free_Count; - this.jsonConnections = message.JsonConnections; - this.staticRamUsage = message.StaticRamUsage; - this.peakRamUsage = message.PeakRamUsage; - this.lastMemTime = message.CurrentTime; - if (this.platform.logBroadcastMemory) { - this.platform.log.info('LC7001 BroadcastMemory message:\n',message); - } - break; - case 'ListZones': - this.platform.log.debug('Message type: ZoneList'); - this.zoneList = message.ZoneList; - if (message.ZoneList.length == 0) { - this.platform.log.warn('LC7001 reports having no zones. Perhaps you need to add some lights.'); - } else { - this.platform.log.debug('Received zone list:\n',message.ZoneList); - //LC7001 does not volunteer the zone list; if we receive it, automatically query properties of each zone. - this.queryLC7001Zones(); - } - break; - case 'ping': - this.platform.log.debug('Message type: Ping'); - this.lastPingSeq = message.PingSeq; - this.lastPingTime = message.CurrentTime; - break; - case 'ReportSystemProperties': - this.platform.log.debug('Message type: ReportSystemProperties'); - if ('PropertyList' in message) { - if ('AddASceneController' in message.PropertyList) { - if (message.PropertyList.AddASceneController && !this.addASceneController) { - this.platform.log.info('LC7001 entered AddASceneController state.'); - } - if (this.addASceneController && !message.PropertyList.AddASceneController) { - this.platform.log.info('LC7001 exited AddASceneController state.') - } - this.addASceneController = message.PropertyList.AddASceneController; - } - if ('AddALight' in message.PropertyList) { - if (message.PropertyList.AddALight && !this.addALight) { - this.platform.log.info('LC7001 entered AddALight state.'); - } - if (this.addALight && !message.PropertyList.AddALight) { - this.platform.log.info('LC7001 exited AddALight state.') - } - this.addALight = message.PropertyList.AddALight; - } - this.timeZone = message.PropertyList.TimeZone; - this.daylightSavingtime = message.PropertyList.DaylightSavingTime; - this.locationInfo = message.PropertyList.LocationInfo; - this.location = message.PropertyList.Location; - this.effectiveTimeZone = message.PropertyList.EffectiveTimeZone; - this.configured = message.PropertyList.Configured; - this.supportsSceneFadeRate = message.PropertyList.SupportSceneFadeRate; - this.mobileAppData = message.PropertyList.MobileAppData; - this.lastSysPropTime = message.PropertyList.CurrentTime; - //Depricated fields - //this.samsungUserToken = message.PropertyList.SamsungUserToken; - //this.samsungRefreshToken = message.PropertyList.SamsungRefreshToken] - } - break; - case 'ReportZoneProperties': - this.platform.log.debug('Message type: ReportZoneProperties'); - if (this.accessories[message.ZID] === undefined) { - this.accessories[message.ZID] = {}; - } - this.accessories[message.ZID].zid = message.ZID; - this.accessories[message.ZID].PropertyList = message.PropertyList; - if (!this.isInitialized) { - this.platform.log.debug('LC7001 interface is not initialized. Requesting check of initialization status in post-processing.'); - checkInitializedWhenDone = true; - } - break; - case 'SetZoneProperties': - this.platform.log.debug('Message type: SetZoneProperties'); - //There is no action to take for this messsage if it is a success. Do not know what non-success looks like, so log it. - if (message.Status != 'Success') { - this.platform.log.error('LC7001 failed set zone:',message); - } - break; - case 'SystemInfo': - this.platform.log.debug('Message type: SystemInfo'); - this.model = message.Model; - this.firmwareVersion = message.FirmwareVersion; - this.firmwareDate = message.FirmwareDate; - this.firmwareBranch = message.FirmwareBranch; - this.macAddress = message.MACAddress; - this.houseID = message.HouseID; - this.updateState = message.UpdateState; - if ('UpdateState' in message && message.UpdateState.Status == 'Ready') { - this.platform.log.info('LC7001 ready to update to firmware version',message.UpdateState.UpdateVersion+':',message.UpdateState.ReleaseNotes) - } - break; - case 'SystemPropertiesChanged': - this.platform.log.debug('Message type: SystemPropertiesChanged'); - this.platform.log.debug('LC7001 reports system properties changed; rescanning....') - this.sendCMDArray([this.cmdGetLC7001Properties()]); - break; - case 'ZoneAdded': - this.platform.log.debug('Message type: ZoneAdded'); - this.platform.log.info('Zone added to LC7001. Requesting rescan of accessories in post-processing.'); - rescanAccessoriesWhenDone = true; - break; - case 'ZoneDeleted': - this.platform.log.debug('Message type: ZoneDeleted'); - this.platform.log.info('Zone deleted from LC7001. Requesting rescan of accessories in post-processing.'); - rescanAccessoriesWhenDone = true; - break; - case 'ZonePropertiesChanged': - this.platform.log.debug('Message type: ZonePropertiesChanged'); - if (this.accessories[message.ZID] === undefined) { - this.platform.log.warn('LC7001 updated unknown zone:',message.ZID); - this.platform.log.debug('Requesting rescan of accessories in post-processing.'); - rescanAccessoriesWhenDone = true; - } else { - this.platform.log.debug('Updating accessory.... Zone:',message.ZID); - if (this.accessories[message.ZID].PropertyList === undefined) { - this.platform.log.debug('Accessory PropertyList undefined; copying wholesale.') - this.accessories[message.ZID].PropertyList = message.PropertyList; - } else { - Object.assign(this.accessories[message.ZID].PropertyList,message.PropertyList); - } - if (this.accessories[message.ZID].platformAccessoryIndex === undefined) { - this.platform.log.debug('Zone has not yet been matched to platform; not emitting event.') - } else { - this.platform.log.debug('LC7001 module emitting "accessoryUpdate" event....') - this.emitter.emit('accessoryUpdate',this.accessories[message.ZID].platformAccessoryIndex); - } - } - break; - default: - if (/^\*+ Got NTP -- IP:/.test(message.Service)) { - this.platform.log.debug('Message type: NTP'); - this.platform.log.debug('NTP succeeded on LC7001.'); - this.lastNTPTime = message.PropertyList.CurrentTime; - } else if (/^\*+ NTP one shot did not work/.test(message.Service)) { - this.platform.log.debug('Message type: NTP'); - this.platform.log.warn('NTP failed on LC7001.'); - } else if (/^\*+ NTP ALT TIME WORKED/.test(message.Service)) { - this.platform.log.debug('Message type: NTP'); - this.platform.log.warn('Alternative NTP succeeded on LC7001.') - this.lastNTPTime = message.PropertyList.CurrentTime; - } else if (/^\*+ NIST ALT TIME DID NOT WORK/.test(message.Service)) { - this.platform.log.debug('Message type: NTP'); - this.platform.log.warn('Alternative NTP failed on LC7001.') - } else { - if (message.ID == 0) { - this.platform.log.error('Unknown LC7001 initiated service:\n',message); - } else { - this.platform.log.error('Unknown LC7001 response service\n',message); - } - } - break; - } - } else if ('Context' in message && /^[0-9]{6}Debug/.test(message.Context)) { - this.platform.log.debug('Message type: Debug'); - if (this.platform.logDebugMessages) { - this.platform.log.info('LC7001 debug message:\n',message); - } - } else { - if (message.ID == 0) { - this.platform.log.error('Unhandled LC7001 initiated message:\n',message); - } else { - this.platform.log.error('Unhanlded LC7001 response message:\n',message); - } - } - } else { - if ('MAC' in message) { - this.platform.log.debug('Message type: MAC'); - this.mac = message.MAC; - } else if ('Service' in message) { - switch(message.Service) { - case 'EliotErrors': - this.platform.log.debug('Message type: EliotErrors'); - if (this.platform.logEliotErrors) { - this.platform.log.info('EliotErrors:\n',message); - } - break; - default: - this.platform.log.error('Unhandled LC7001 initiaged message:\n',message); - break; - } - } else if ('ArtikEvent' in message) { - this.platform.log.debug('Message type: ArtikEvent'); - this.platform.log.debug('ArtikEvent received:\n',message); - } else { - this.platform.log.error('Unhandled LC7001 message:\n',message); - } - } - this.platform.log.debug('Finished processing message:',JSON.stringify(message)); - return[checkInitializedWhenDone,rescanAccessoriesWhenDone]; - } - - private queryLC7001Zones(): void { - this.platform.log.debug('Querying LC7001 zones....'); - if (this.zoneList.length == 0) { - this.platform.log.debug('Zone list is empty. Nothing to query.') - } else { - var cmdArray: object[] = []; - this.zoneList.forEach((value: any) => { - if ('ZID' in value){ - this.platform.log.debug('Querying zone:',value.ZID); - cmdArray.push(this.cmdGetAccessory(value.ZID)); - } - }); - this.sendCMDArray(cmdArray); - this.platform.log.debug('Finished querying LC7001 zones.'); - } - } - - private sendCMD(cmd: object): void { - this.platform.log.debug('Checking if socket is not destroyed....'); - if (!this.interface.destroyed) { - this.platform.log.debug('Socket open. Sending command:',cmd); - this.interface.write((JSON.stringify(cmd) + this.delimiter),'ascii'); - this.commandQueue.push(cmd); - } else { - this.platform.log.debug('Socket destroyed.'); - this.platform.log.warn('No active connection to LC7001. Discarding command:',cmd); - } - } - - private sendCMDArray(cmdArray: object[]): void { - var cmd = ''; - this.platform.log.debug('Checking if socket is not destroyed....'); - if (!this.interface.destroyed) { - cmdArray.forEach((value) => { - cmd = cmd + JSON.stringify(value) + this.delimiter; - this.commandQueue.push(value); - }); - this.platform.log.debug('Socket open. Sending command:',cmd); - this.interface.write(cmd,'ascii'); - } else { - this.platform.log.debug('Socket destroyed.'); - this.platform.log.warn('No active connection to LC7001. Discarding command:',cmd); - } - - } - - public setAccessory(id:number,PropertyList:any): void { - this.platform.log.debug('Setting zone',id,'to PropertyList:',PropertyList); - this.sendCMDArray([this.cmdSetAccessory(id,PropertyList)]); - } - - public scanAccessories(): void { - this.platform.log.debug('Scanning LC7001 for accessories....'); - this.sendCMDArray([this.cmdListAccessories()]); - } - +import crypto from 'crypto'; + +import { + EventEmitter +} from 'events'; + +import { + Socket, + TcpSocketConnectOpts +} from 'net'; + +import { + PlatformLC7001 +} from './platform'; + +export class LC7001 { + //Interface to platform + public accessories: any[] = []; + public isInitialized: boolean = false; + + //Node.js objects + public emitter: EventEmitter; + private interface: Socket; + private readonly tcpOptions: TcpSocketConnectOpts; + + //Private properties + private _commandID: number = 0; + private passwordHash: Buffer; + private isAuthenticated: boolean; + private readonly delimiter: string; + private tcpBuffer: string = ''; + private commandQueue: any[] = []; + private responseQueue: any[] = []; + + //LC7001-supplied properties + private addALight: any = false; + private addASceneController: any = false; + private authExempt: any = undefined; + private configured: any = undefined; + private connectionSequenceNumber: any = undefined; + private daylightSavingtime: any = undefined; + private effectiveTimeZone: any = undefined; + private firmwareBranch: any = undefined; + private firmwareDate: any = undefined; + private firmwareVersion: any = undefined; + private firstSystemTime: any = undefined; + private firstTimeRecorded: any = undefined; + private freeMemory: any = undefined; + private freeMemLowWater: any = undefined; + private free_Count: any = undefined; + private houseID: any = undefined; + private jsonConnections: any = undefined; + private jsonErr: any = undefined; + private location: any = undefined; + private locationInfo: any = undefined; + private mac: any = undefined; + public macAddress: any = undefined; + private malloc_Count: any = undefined; + private mobileAppData: any = undefined; + private model: any = undefined; + private otherRecvErr: any = undefined; + private peakRamUsage: any = undefined; + private qmotionTryFind: any = undefined; + private shortMACAddress: any = undefined; + private staticRamUsage: any = undefined; + private supportsSceneFadeRate: any = undefined; + private taskHeartbeatBitmask: any = undefined; + private timeZone: any = undefined; + private updateState: any = undefined; + private zoneList: any[] = []; + //Depricated properties + //private samsungUserToken: any = undefined; + //private samsungRefreshToken: any = undefined; + + //LC7001-derived properties + private lastDiagTime: any = undefined; + private lastMemTime: any = undefined; + private lastNTPTime: any = undefined; + private lastPingSeq: any = undefined; + private lastPingTime: any = undefined; + private lastSysPropTime: any = undefined; + + constructor( + public readonly platform: PlatformLC7001, + password: string = '', + tcpOptions:TcpSocketConnectOpts, + delimiter: string = '\0' + ) { + var passwordHasher = crypto.createHash('MD5'); + passwordHasher.update(password); + + this.passwordHash = passwordHasher.digest(); + this.isAuthenticated = false; + this.tcpOptions = tcpOptions; + this.delimiter = delimiter; + + this.emitter = new EventEmitter; + this.interface = new Socket(); + this.interface.on('connect',() => { + this.platform.log.info('Connection to LC7001 established.'); + this.platform.log.debug('-->IP Version: ',this.interface.remoteFamily); + this.platform.log.debug('-->IP Address: ',this.interface.remoteAddress); + this.platform.log.debug('-->TCP Port: ',this.interface.remotePort); + this.platform.log.debug('-->Local IP Address:',this.interface.localAddress); + this.platform.log.debug('-->Local TCP Port: ',this.interface.localPort); + }); + this.interface.on('close',(hadError) => { + this.tcpBuffer = ''; + if (hadError) { + this.platform.log.error('Connection to LC7001 closed due to error. Waiting 30 seconds to reconnect....'); + setTimeout(this.connectLC7001.bind(this),30000); + } else { + this.platform.log.info('Connection to LC7001 closed. Reconnecting....'); + this.connectLC7001(); + } + }); + this.interface.on('data',(data: string) => { + this.platform.log.debug('Data received from LC7001 (stringified):',JSON.stringify(data)); + if (data.length <= 0) { + this.platform.log.debug('Length of data is zero! Nothing to do.') + } else { + this.processBuffer(data); + } + }); + this.interface.on('error',(err) => { + this.platform.log.error('Error on LC7001 connection:',err.toString()); + }); + this.interface.on('ready',() => { + this.platform.log.debug('Connection to LC7001 ready for use.') + //Previously, before authentication requirement, this is where commands began issuing. Moved to 'data' emitter. + //this.sendCMDArray([this.cmdGetSystemInfo(),this.cmdGetLC7001Properties(),this.cmdListAccessories()]); + }); + this.interface.on('timeout',() => { + this.platform.log.warn('Connection to LC7001 has been inactive for 30 seconds. Destroying connection....'); + this.interface.destroy(); + }); + + this.connectLC7001(); + } + + private answerChallenge(challenge: Buffer): void { + var answer: string; + var answerCipher = crypto.createCipheriv('AES-128-ECB',this.passwordHash,null); + this.platform.log.debug('Generating challenge answer....'); + this.platform.log.debug('Using challenge:',challenge.toString('hex').toUpperCase()); + //this.platform.log.debug('Using password hash:',this.passwordHash.toString('hex').toUpperCase()); + answer = answerCipher.update(challenge).toString('hex').toUpperCase(); + this.platform.log.debug('Answer generated:',answer); + this.platform.log.debug('Sending answer to LC7001....') + this.interface.write(answer,'ascii'); + } + + private checkInitialized(): void { + this.platform.log.debug('Testing to see if LC7001 interface is initialized....'); + this.isInitialized = this.isInitializedTest(); + if (this.isInitialized) { + this.platform.log.debug('LC7001 interface is initialized. Emitting "initialized" event....'); + this.emitter.emit('initialized'); + } else { + this.platform.log.debug('LC7001 interface is not initialized.') + } + + } + + //LC7001 sends a response with the name ID as the command. We utilize an ID field that is inrecemented every time it is requested to serialize commands. + private get commandID(): number { + if (this._commandID >= Number.MAX_SAFE_INTEGER) { + this._commandID = 1; + } else { + this._commandID = this._commandID + 1; + } + return this._commandID; + } + + private cmdGetAccessory(id: number): object { + var cmd: any = {}; + this.platform.log.debug('Building ReportZoneProperties command....') + cmd.ID = this.commandID; + cmd.Service = 'ReportZoneProperties'; + cmd.ZID = id; + this.platform.log.debug('Command:',cmd) + return cmd; + } + + private cmdGetLC7001Properties(): object { + var cmd:any = {}; + this.platform.log.debug('Building ReportSystemProperties command....') + cmd.ID = this.commandID; + cmd.Service = 'ReportSystemProperties'; + this.platform.log.debug('Command:',cmd) + return cmd; + } + + private cmdGetSystemInfo(): object { + var cmd:any = {}; + this.platform.log.debug('Building SystemInfo command....') + cmd.ID = this.commandID; + cmd.Service = 'SystemInfo'; + this.platform.log.debug('Command:',cmd) + return cmd; + } + + private cmdListAccessories(): object { + var cmd:any = {}; + this.platform.log.debug('Building ListZones command....') + cmd.ID = this.commandID; + cmd.Service = 'ListZones'; + this.platform.log.debug('Command:',cmd) + return cmd; + } + + private cmdSetAccessory(id: number,PropertyList:any) { + var cmd:any = {}; + this.platform.log.debug('Building SetZoneProperties command....') + cmd.ID = this.commandID; + cmd.Service = 'SetZoneProperties'; + cmd.ZID = id; + cmd.PropertyList = PropertyList; + this.platform.log.debug('Command:',cmd) + return cmd; + } + + private connectLC7001(): void { + this.platform.log.info('Connecting to LC7001....'); + this.platform.log.debug('TCP Options:'); + this.platform.log.debug('--> host:',this.tcpOptions.host); + this.platform.log.debug('--> port:',this.tcpOptions.port); + this.platform.log.debug('--> localAddress:',this.tcpOptions.localAddress); + this.platform.log.debug('--> localPort:',this.tcpOptions.localPort); + this.platform.log.debug('--> family:',this.tcpOptions.family); + this.interface.connect(this.tcpOptions,() => { + this.interface.setEncoding('ascii'); + this.interface.setTimeout(30000); + }); + } + + //LC7001 is initialized when zone list is populated and properties from each zone have been queried. + //If the LC7001 has no zones, it will never be initialized. + private isInitializedTest(): boolean { + var testcase:boolean = true; + + if (this.zoneList.length == 0) { + this.platform.log.debug('Zone list is empty: Fail'); + testcase = false; + } else { + this.platform.log.debug('Zone list is populated: Pass'); + if (this.accessories.length == 0) { + this.platform.log.debug('Accessories list is empty: Fail'); + testcase = false; + } else { + this.zoneList.forEach((value) => { + if (this.accessories[value.ZID] === undefined) { + this.platform.log.debug('Zone',value.ZID,'is missing from accessories list: Fail') + testcase = false; + } else { + this.platform.log.debug('Found zone',value.ZID,'on accessories list: Pass') + } + }); + } + } + return testcase; + } + + private processBuffer(data: string): void { + this.platform.log.debug('Processing data received from LC7001....'); + this.platform.log.debug('Starting buffer:',JSON.stringify(this.tcpBuffer)); + this.platform.log.debug('Data received:',JSON.stringify(data)); + this.platform.log.debug('Delimiter:',JSON.stringify(this.delimiter)); + var splitBuffer = data.split(this.delimiter); + splitBuffer[0] = this.tcpBuffer + splitBuffer[0]; + this.tcpBuffer = ''; + this.platform.log.debug('Segments received:',splitBuffer.length); + splitBuffer.forEach((value,index) => { + this.platform.log.debug('-->',(index + 1),':',JSON.stringify(value)); + }); + if (splitBuffer.length > 0) { + splitBuffer.forEach((value,index) => { + this.platform.log.debug('Processing segment:',(index + 1)); + if (value.length == 0) { + this.platform.log.debug('Segment has length 0; skipping.'); + } else { + this.platform.log.debug('Checking if segment is good JSON....'); + try { + this.responseQueue.push(JSON.parse(value)); + this.platform.log.debug('Segment is good JSON. Added JSON to Receive Queue.'); + if (!this.isAuthenticated) { + this.platform.log.debug('LC7001 must not require authentication. Initializing LC7001....'); + this.isAuthenticated = true; + this.sendCMDArray([this.cmdGetSystemInfo(),this.cmdGetLC7001Properties(),this.cmdListAccessories()]); + } + } catch { + this.platform.log.debug('Segment is not good JSON. Checking if segment is an authentication message....'); + if (/^Hello V1 /.test(value)) { + this.platform.log.debug('Segment is an authentication message. This LC7001 requires authentication.'); + this.isAuthenticated = false; + } else if (/^[0-9A-F]{32} [0-9A-F]{12}/.test(value)) { + this.platform.log.debug('LC7001 has sent an authentication challenge.'); + this.answerChallenge(Buffer.from(value.substr(0,32),'hex')); + } else if (/^\[SETKEY\]/.test(value)) { + this.platform.log.warn('Your LC7001 requires a password be configured. Please set the password using the Legrand Lighting Control app and add the password to configuration.'); + this.platform.log.warn('This plugin will not work until a password is set on the LC7001 and entered into the configuration.'); + } else if (/^\[OK\]/.test(value)) { + this.platform.log.info('Successfully authenticated to LC7001. Initializing LC7001....') + this.isAuthenticated = true; + this.sendCMDArray([this.cmdGetSystemInfo(),this.cmdGetLC7001Properties(),this.cmdListAccessories()]); + } else if (/^\[INVALID\]/.test(value)) { + this.platform.log.error('Failed to authenticate to LC7001; check the password. LC7001 will disconnect.'); + } else { + this.platform.log.debug('Segment is not an authentication message. Checking for undelimited JSON....'); + if (value.indexOf('}{') >= 0) { + this.platform.log.warn('Possible undelimited JSON detected. Replacing all }{s with delimited version.'); + var splitValue = value.replace(/\}\{/g, ('}' + this.delimiter + '{')).split(this.delimiter); + this.platform.log.debug('Salvaged segments:',splitValue.length); + splitValue.forEach((value2,index2) => { + this.platform.log.debug('-->',(index2 + 1),':',JSON.stringify(value2)); + }); + splitValue.forEach((value2,index2) => { + try { + this.responseQueue.push(JSON.parse(value2)); + this.platform.log.info('Succcesfully salvaged JSON. Added JSON to Receive Queue.'); + } catch(err) { + this.platform.log.error('Unable to parse segment:',value2); + this.platform.log.debug('Salvaged segment',(index2 + 1),'is not good JSON.'); + this.platform.log.debug('Skipping....'); + } + }); + } else { + if (index = splitBuffer.length - 1) { + this.platform.log.debug('Unable to parse last segment; saving in buffer.'); + this.tcpBuffer = value; + } else { + this.platform.log.error('Unable to parse segment:',value); + this.platform.log.debug('Skipping....'); + } + } + } + } + } + }); + } + this.processresponseQueue(); + } + + private processresponseQueue(): void { + var message: any = {}; + var postProcessing: boolean[]; + var runCheckInitialized: boolean = false; + var runScanAccessories: boolean = false; + + this.platform.log.debug('Processing Receive Queue....'); + this.platform.log.debug('Receive Queue length:',this.responseQueue.length); + if (this.responseQueue.length == 0) { + this.platform.log.debug('Receive Queue empty; nothing to do.') + } else { + this.platform.log.debug('Receive Queue contents:') + this.responseQueue.forEach((value,index) => { + this.platform.log.debug('-->',(index + 1),':',JSON.stringify(value)) + },this); + while (this.responseQueue.length > 0) { + message = this.responseQueue.shift(); + if ('ID' in message && message.ID > 0) { + this.platform.log.debug('Message contains non-zero ID. Checking Command Queue for matching command....') + this.commandQueue.forEach((value,index,array) => { + if (value.ID == message.ID) { + this.platform.log.debug('Found matching command:',value); + this.platform.log.debug('Removing command from Command Queue.'); + array.splice(index,1); + } + }); + } + postProcessing = this.processLC7001Message(message); + if (postProcessing[0]) { + runCheckInitialized = true; + } + if (postProcessing[1]) { + this.isInitialized = false; + runCheckInitialized = true; + } + } + if (!runCheckInitialized && !runScanAccessories) { + this.platform.log.debug('Response Queue empty. No post-processing requested.'); + } else { + this.platform.log.debug('Response Queue empty. Running post-processing....'); + if (runCheckInitialized) { + this.platform.log.debug('Initialization check requested.'); + this.checkInitialized(); + } + if (runScanAccessories) { + this.platform.log.debug('Accessory scan requested.'); + } + } + } + } + + private processLC7001Message(message: any): boolean[] { + var checkInitializedWhenDone: boolean = false; + var rescanAccessoriesWhenDone: boolean = false; + this.platform.log.debug('Processing message:',JSON.stringify(message)); + if ('ID' in message) { + if ('Service' in message) { + switch(message.Service) { + case 'BroadcastDiagnostics': + this.platform.log.debug('Message type: BroadcastDiagnostics'); + this.firmwareVersion = message.FirmwareVersion; + this.firstSystemTime = message.firstSystemTime; + this.shortMACAddress = message.MACAddress; + this.connectionSequenceNumber = message.connectionSequenceNum; + this.firstTimeRecorded = message.FirstTimeRecorded; + this.authExempt = message.AuthExempt; + this.otherRecvErr = message.other_recv_err; + this.jsonErr = message.json_err; + this.qmotionTryFind = message.qmotion_try_find; + this.taskHeartbeatBitmask = message.task_heartbeat_bitmask; + this.lastDiagTime = message.CurrentTime; + if (this.platform.logBroadcastDiagnostics) { + this.platform.log.info('LC7001 BroadcastDiagnostices message:\n',message); + } + break; + case 'BroadcastMemory': + this.platform.log.debug('Message type: BroadcastMemory'); + this.freeMemory = message.FreeMemory; + this.freeMemLowWater = message.FreeMemLowWater; + this.malloc_Count = message.Malloc_Count; + this.free_Count = message.Free_Count; + this.jsonConnections = message.JsonConnections; + this.staticRamUsage = message.StaticRamUsage; + this.peakRamUsage = message.PeakRamUsage; + this.lastMemTime = message.CurrentTime; + if (this.platform.logBroadcastMemory) { + this.platform.log.info('LC7001 BroadcastMemory message:\n',message); + } + break; + case 'ListZones': + this.platform.log.debug('Message type: ZoneList'); + this.zoneList = message.ZoneList; + if (message.ZoneList.length == 0) { + this.platform.log.warn('LC7001 reports having no zones. Perhaps you need to add some lights.'); + } else { + this.platform.log.debug('Received zone list:\n',message.ZoneList); + //LC7001 does not volunteer the zone list; if we receive it, automatically query properties of each zone. + this.queryLC7001Zones(); + } + break; + case 'ping': + this.platform.log.debug('Message type: Ping'); + this.lastPingSeq = message.PingSeq; + this.lastPingTime = message.CurrentTime; + break; + case 'ReportSystemProperties': + this.platform.log.debug('Message type: ReportSystemProperties'); + if ('PropertyList' in message) { + if ('AddASceneController' in message.PropertyList) { + if (message.PropertyList.AddASceneController && !this.addASceneController) { + this.platform.log.info('LC7001 entered AddASceneController state.'); + } + if (this.addASceneController && !message.PropertyList.AddASceneController) { + this.platform.log.info('LC7001 exited AddASceneController state.') + } + this.addASceneController = message.PropertyList.AddASceneController; + } + if ('AddALight' in message.PropertyList) { + if (message.PropertyList.AddALight && !this.addALight) { + this.platform.log.info('LC7001 entered AddALight state.'); + } + if (this.addALight && !message.PropertyList.AddALight) { + this.platform.log.info('LC7001 exited AddALight state.') + } + this.addALight = message.PropertyList.AddALight; + } + this.timeZone = message.PropertyList.TimeZone; + this.daylightSavingtime = message.PropertyList.DaylightSavingTime; + this.locationInfo = message.PropertyList.LocationInfo; + this.location = message.PropertyList.Location; + this.effectiveTimeZone = message.PropertyList.EffectiveTimeZone; + this.configured = message.PropertyList.Configured; + this.supportsSceneFadeRate = message.PropertyList.SupportSceneFadeRate; + this.mobileAppData = message.PropertyList.MobileAppData; + this.lastSysPropTime = message.PropertyList.CurrentTime; + //Depricated fields + //this.samsungUserToken = message.PropertyList.SamsungUserToken; + //this.samsungRefreshToken = message.PropertyList.SamsungRefreshToken] + } + break; + case 'ReportZoneProperties': + this.platform.log.debug('Message type: ReportZoneProperties'); + if (this.accessories[message.ZID] === undefined) { + this.accessories[message.ZID] = {}; + } + this.accessories[message.ZID].zid = message.ZID; + this.accessories[message.ZID].PropertyList = message.PropertyList; + if (!this.isInitialized) { + this.platform.log.debug('LC7001 interface is not initialized. Requesting check of initialization status in post-processing.'); + checkInitializedWhenDone = true; + } + break; + case 'SetZoneProperties': + this.platform.log.debug('Message type: SetZoneProperties'); + //There is no action to take for this messsage if it is a success. Do not know what non-success looks like, so log it. + if (message.Status != 'Success') { + this.platform.log.error('LC7001 failed set zone:',message); + } + break; + case 'SystemInfo': + this.platform.log.debug('Message type: SystemInfo'); + this.model = message.Model; + this.firmwareVersion = message.FirmwareVersion; + this.firmwareDate = message.FirmwareDate; + this.firmwareBranch = message.FirmwareBranch; + this.macAddress = message.MACAddress; + this.houseID = message.HouseID; + this.updateState = message.UpdateState; + if ('UpdateState' in message && message.UpdateState.Status == 'Ready') { + this.platform.log.info('LC7001 ready to update to firmware version',message.UpdateState.UpdateVersion+':',message.UpdateState.ReleaseNotes) + } + break; + case 'SystemPropertiesChanged': + this.platform.log.debug('Message type: SystemPropertiesChanged'); + this.platform.log.debug('LC7001 reports system properties changed; rescanning....') + this.sendCMDArray([this.cmdGetLC7001Properties()]); + break; + case 'ZoneAdded': + this.platform.log.debug('Message type: ZoneAdded'); + this.platform.log.info('Zone added to LC7001. Requesting rescan of accessories in post-processing.'); + rescanAccessoriesWhenDone = true; + break; + case 'ZoneDeleted': + this.platform.log.debug('Message type: ZoneDeleted'); + this.platform.log.info('Zone deleted from LC7001. Requesting rescan of accessories in post-processing.'); + rescanAccessoriesWhenDone = true; + break; + case 'ZonePropertiesChanged': + this.platform.log.debug('Message type: ZonePropertiesChanged'); + if (this.accessories[message.ZID] === undefined) { + this.platform.log.warn('LC7001 updated unknown zone:',message.ZID); + this.platform.log.debug('Requesting rescan of accessories in post-processing.'); + rescanAccessoriesWhenDone = true; + } else { + this.platform.log.debug('Updating accessory.... Zone:',message.ZID); + if (this.accessories[message.ZID].PropertyList === undefined) { + this.platform.log.debug('Accessory PropertyList undefined; copying wholesale.') + this.accessories[message.ZID].PropertyList = message.PropertyList; + } else { + Object.assign(this.accessories[message.ZID].PropertyList,message.PropertyList); + } + if (this.accessories[message.ZID].platformAccessoryIndex === undefined) { + this.platform.log.debug('Zone has not yet been matched to platform; not emitting event.') + } else { + this.platform.log.debug('LC7001 module emitting "accessoryUpdate" event....') + this.emitter.emit('accessoryUpdate',this.accessories[message.ZID].platformAccessoryIndex); + } + } + break; + default: + if (/^\*+ Got NTP -- IP:/.test(message.Service)) { + this.platform.log.debug('Message type: NTP'); + this.platform.log.debug('NTP succeeded on LC7001.'); + this.lastNTPTime = message.PropertyList.CurrentTime; + } else if (/^\*+ NTP one shot did not work/.test(message.Service)) { + this.platform.log.debug('Message type: NTP'); + this.platform.log.warn('NTP failed on LC7001.'); + } else if (/^\*+ NTP ALT TIME WORKED/.test(message.Service)) { + this.platform.log.debug('Message type: NTP'); + this.platform.log.warn('Alternative NTP succeeded on LC7001.') + this.lastNTPTime = message.PropertyList.CurrentTime; + } else if (/^\*+ NIST ALT TIME DID NOT WORK/.test(message.Service)) { + this.platform.log.debug('Message type: NTP'); + this.platform.log.warn('Alternative NTP failed on LC7001.') + } else { + if (message.ID == 0) { + this.platform.log.error('Unknown LC7001 initiated service:\n',message); + } else { + this.platform.log.error('Unknown LC7001 response service\n',message); + } + } + break; + } + } else if ('Context' in message && /^[0-9]{6}Debug/.test(message.Context)) { + this.platform.log.debug('Message type: Debug'); + if (this.platform.logDebugMessages) { + this.platform.log.info('LC7001 debug message:\n',message); + } + } else { + if (message.ID == 0) { + this.platform.log.error('Unhandled LC7001 initiated message:\n',message); + } else { + this.platform.log.error('Unhanlded LC7001 response message:\n',message); + } + } + } else { + if ('MAC' in message) { + this.platform.log.debug('Message type: MAC'); + this.mac = message.MAC; + } else if ('Service' in message) { + switch(message.Service) { + case 'EliotErrors': + this.platform.log.debug('Message type: EliotErrors'); + if (this.platform.logEliotErrors) { + this.platform.log.info('EliotErrors:\n',message); + } + break; + default: + this.platform.log.error('Unhandled LC7001 initiaged message:\n',message); + break; + } + } else if ('ArtikEvent' in message) { + this.platform.log.debug('Message type: ArtikEvent'); + this.platform.log.debug('ArtikEvent received:\n',message); + } else { + this.platform.log.error('Unhandled LC7001 message:\n',message); + } + } + this.platform.log.debug('Finished processing message:',JSON.stringify(message)); + return[checkInitializedWhenDone,rescanAccessoriesWhenDone]; + } + + private queryLC7001Zones(): void { + this.platform.log.debug('Querying LC7001 zones....'); + if (this.zoneList.length == 0) { + this.platform.log.debug('Zone list is empty. Nothing to query.') + } else { + var cmdArray: object[] = []; + this.zoneList.forEach((value: any) => { + if ('ZID' in value){ + this.platform.log.debug('Querying zone:',value.ZID); + cmdArray.push(this.cmdGetAccessory(value.ZID)); + } + }); + this.sendCMDArray(cmdArray); + this.platform.log.debug('Finished querying LC7001 zones.'); + } + } + + private sendCMD(cmd: object): void { + this.platform.log.debug('Checking if socket is not destroyed....'); + if (!this.interface.destroyed) { + this.platform.log.debug('Socket open. Sending command:',cmd); + this.interface.write((JSON.stringify(cmd) + this.delimiter),'ascii'); + this.commandQueue.push(cmd); + } else { + this.platform.log.debug('Socket destroyed.'); + this.platform.log.warn('No active connection to LC7001. Discarding command:',cmd); + } + } + + private sendCMDArray(cmdArray: object[]): void { + var cmd = ''; + this.platform.log.debug('Checking if socket is not destroyed....'); + if (!this.interface.destroyed) { + cmdArray.forEach((value) => { + cmd = cmd + JSON.stringify(value) + this.delimiter; + this.commandQueue.push(value); + }); + this.platform.log.debug('Socket open. Sending command:',cmd); + this.interface.write(cmd,'ascii'); + } else { + this.platform.log.debug('Socket destroyed.'); + this.platform.log.warn('No active connection to LC7001. Discarding command:',cmd); + } + + } + + public setAccessory(id:number,PropertyList:any): void { + this.platform.log.debug('Setting zone',id,'to PropertyList:',PropertyList); + this.sendCMDArray([this.cmdSetAccessory(id,PropertyList)]); + } + + public scanAccessories(): void { + this.platform.log.debug('Scanning LC7001 for accessories....'); + this.sendCMDArray([this.cmdListAccessories()]); + } + } \ No newline at end of file diff --git a/src/platform.ts b/src/platform.ts index fb0474c..52264ae 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -47,6 +47,7 @@ export class PlatformLC7001 implements DynamicPlatformPlugin { //LC7001 Properties private lc7001: LC7001; + private readonly password: string = ''; private readonly tcpOptions: TcpSocketConnectOpts = {host:'LCM1.local',port:2112}; private readonly jsonDelimiter: string = '\0'; @@ -59,8 +60,15 @@ export class PlatformLC7001 implements DynamicPlatformPlugin { this.log.info('Platform initializing....'); this.log.debug('Parsing platform configuration:'); for (var propertyNameConfig in this.config) { - this.log.debug("-->",propertyNameConfig,":",this.config[propertyNameConfig]); + if (propertyNameConfig == 'lc7001-password') { + this.log.debug('-->',propertyNameConfig,': ********'); + } else { + this.log.debug('-->',propertyNameConfig,':',this.config[propertyNameConfig]); + } }; + if ('lc7001-password' in this.config) { + this.password = this.config['lc7001-password']; + } if ('lc7001-hostname' in this.config) { this.tcpOptions.host = this.config['lc7001-hostname']; } @@ -112,7 +120,7 @@ export class PlatformLC7001 implements DynamicPlatformPlugin { } this.log.debug('Creating LC7001 interface....'); - this.lc7001 = new LC7001(this,this.tcpOptions,this.jsonDelimiter); + this.lc7001 = new LC7001(this,this.password,this.tcpOptions,this.jsonDelimiter); this.log.debug('LC7001 interface created.'); this.lc7001.emitter.on('initialized',() => { this.log.debug('Received "initialized" event from LC7001 module.'); @@ -311,7 +319,7 @@ export class PlatformLC7001 implements DynamicPlatformPlugin { this.log.info('Configuring accessory:',accessory.displayName); this.log.debug('Adding listener for "identify" event.') accessory.on('identify', () => { - this.log.info('Accessory',accessory.displayName,"identified."); + this.log.info('Accessory',accessory.displayName,'identified.'); }); if (accessory.getService(this.api.hap.Service.Lightbulb) !== undefined) { if (accessory.getService(this.api.hap.Service.Lightbulb)!.testCharacteristic(this.api.hap.Characteristic.On)) {