homebridge-rinnai-touch-platform
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -5,2 +5,6 @@ # Change Log | ||
## 3.1.2 (2020-10-20) | ||
* [FIX] Failed TCP/IP connection causes plugin to crash | ||
## 3.1.1 (2020-10-17) | ||
@@ -7,0 +11,0 @@ |
@@ -23,3 +23,3 @@ /// <reference types="node" /> | ||
private receiveMessage; | ||
private handleError; | ||
private handleConnectionError; | ||
get hasConnectionError(): boolean; | ||
@@ -26,0 +26,0 @@ private get nextSequence(); |
@@ -53,3 +53,3 @@ "use strict"; | ||
// error handler | ||
this.tcp.on('error', this.handleError.bind(this)); | ||
this.tcp.on('connection_error', this.handleConnectionError.bind(this)); | ||
// Ping module | ||
@@ -147,6 +147,8 @@ this.pingIntervalId = setInterval(async () => { | ||
} | ||
async handleError(error) { | ||
async handleConnectionError(error) { | ||
this.platform.log.debug(this.constructor.name, 'handleError', error); | ||
try { | ||
this.platform.log.warn(`TCP Connection failed. Attempting to reconnect [Error: ${error}]`); | ||
this.connectionError = true; | ||
this.emit('connection'); | ||
this.stop(); | ||
@@ -153,0 +155,0 @@ await this.delay(2000); |
@@ -38,3 +38,3 @@ "use strict"; | ||
this.closeSocket(true); | ||
this.emit('error', error.message); | ||
this.emit('connection_error', error.message); | ||
reject(error); | ||
@@ -47,3 +47,3 @@ }); | ||
this.closeSocket(true); | ||
this.emit('error', 'TCP Connection timed out'); | ||
this.emit('connection_error', 'TCP Connection timed out'); | ||
reject(new Error('TCP Connection timed out')); | ||
@@ -50,0 +50,0 @@ }); |
{ | ||
"displayName": "Rinnai Touch Platform", | ||
"name": "homebridge-rinnai-touch-platform", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Homebridge Plugin to control heating/cooling via a Rinnai Touch WiFi Module", | ||
@@ -6,0 +6,0 @@ "license": "Apache-2.0", |
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
298547
3613