homebridge-rinnai-touch-platform
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -5,2 +5,7 @@ # Change Log | ||
## 3.0.4 (2020-08-22) | ||
* [FIX] Handle status with missing 2nd element | ||
* Update dependencies | ||
## 3.0.3 (2020-07-24) | ||
@@ -7,0 +12,0 @@ |
@@ -91,7 +91,7 @@ "use strict"; | ||
await this.delay(100); | ||
if (ts !== this.timestamp) { | ||
if (ts !== this.timestamp && this.status !== undefined) { | ||
return this.status; | ||
} | ||
} | ||
throw new Error('Failed to get new status'); | ||
throw new Error('No valid status received from WiFi module.'); | ||
} | ||
@@ -212,11 +212,20 @@ const command = this.getCommand(request); | ||
dataHandler(message) { | ||
var _a; | ||
this.platform.log.debug(this.constructor.name, 'dataHandler', message); | ||
this.sequenceNumber = parseInt(message.substr(1, 6)); | ||
this.timestamp = Date.now(); | ||
const newStatus = message.substr(7); | ||
if (this.previousStatus !== newStatus) { | ||
this.status = JSON.parse(newStatus); | ||
this.previousStatus = newStatus; | ||
this.emit('status', this.status); | ||
try { | ||
this.sequenceNumber = parseInt(message.substr(1, 6)); | ||
this.timestamp = Date.now(); | ||
const newStatus = message.substr(7); | ||
if (this.previousStatus !== newStatus) { | ||
const status = JSON.parse(newStatus); | ||
if (((_a = status === null || status === void 0 ? void 0 : status.length) !== null && _a !== void 0 ? _a : 0) === 2) { | ||
this.status = status; | ||
this.previousStatus = newStatus; | ||
this.emit('status', status); | ||
} | ||
} | ||
} | ||
catch (error) { | ||
this.platform.log.error(error); | ||
} | ||
} | ||
@@ -223,0 +232,0 @@ async delay(ms) { |
@@ -47,3 +47,12 @@ "use strict"; | ||
try { | ||
const status = await this.queueService.execute({ type: QueueService_1.RequestTypes.Get }); | ||
let status; | ||
while (status === undefined) { | ||
try { | ||
status = await this.queueService.execute({ type: QueueService_1.RequestTypes.Get }); | ||
} | ||
catch (_a) { | ||
this.platform.log.info('Next attempt in 10 seconds.'); | ||
await this.queueService.delay(10000); | ||
} | ||
} | ||
for (const state of ['HasHeater', 'HasCooler', 'HasEvap', 'HasMultiSP']) { | ||
@@ -50,0 +59,0 @@ this.states[state] = this.stateService.getState(state, status) === 'Y'; |
{ | ||
"displayName": "Rinnai Touch Platform", | ||
"name": "homebridge-rinnai-touch-platform", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "Homebridge Plugin to control heating/cooling via a Rinnai Touch WiFi Module", | ||
@@ -48,7 +48,7 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@types/node": "^14.0.26", | ||
"@typescript-eslint/eslint-plugin": "^3.7.0", | ||
"@typescript-eslint/parser": "^3.7.0", | ||
"eslint": "^7.5.0", | ||
"homebridge": "^1.1.1", | ||
"@types/node": "^14.6.0", | ||
"@typescript-eslint/eslint-plugin": "^3.9.1", | ||
"@typescript-eslint/parser": "^3.9.1", | ||
"eslint": "^7.7.0", | ||
"homebridge": "^1.1.2", | ||
"nodemon": "^2.0.4", | ||
@@ -55,0 +55,0 @@ "rimraf": "^3.0.2", |
@@ -44,3 +44,3 @@ # Homebridge Plugin for the Rinnai Touch WiFi Module | ||
It is also recommended that you remove the `cachedAccessories` file from the `./homebridge/accessories` folder. | ||
It is also recommended that you remove the `cachedAccessories` file from the `.homebridge/accessories` folder. | ||
@@ -47,0 +47,0 @@ ## Configuration |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
287166
3449