homebridge-rinnai-touch-platform
Advanced tools
Comparing version 3.0.5 to 3.0.6
@@ -5,2 +5,9 @@ # Change Log | ||
## 3.0.6 (2020-08-31) | ||
* [FIX] TCP socket not closed after an exception or timeout occurs | ||
* [FIX] Allow status which has a sequence number of 0 | ||
* Add funding attribute to package.json | ||
* Update dependencies | ||
## 3.0.5 (2020-08-23) | ||
@@ -7,0 +14,0 @@ |
@@ -33,3 +33,3 @@ "use strict"; | ||
get isValid() { | ||
return this._sequence !== undefined && this._sequence !== 0 && this._status !== undefined; | ||
return this._sequence !== undefined && this._status !== undefined; | ||
} | ||
@@ -36,0 +36,0 @@ toString() { |
@@ -15,2 +15,3 @@ /// <reference types="node" /> | ||
connect(): Promise<void>; | ||
closeSocket(clearAddress: boolean): void; | ||
destroy(): void; | ||
@@ -17,0 +18,0 @@ write(data: string): Promise<void>; |
@@ -37,7 +37,3 @@ "use strict"; | ||
this.socket.on('error', (error) => { | ||
this.address = undefined; | ||
if (this.socket) { | ||
this.socket.removeAllListeners(); | ||
this.socket = undefined; | ||
} | ||
this.closeSocket(true); | ||
reject(error); | ||
@@ -49,7 +45,3 @@ }); | ||
this.socket.on('timeout', () => { | ||
this.address = undefined; | ||
if (this.socket) { | ||
this.socket.removeAllListeners(); | ||
this.socket = undefined; | ||
} | ||
this.closeSocket(true); | ||
reject(new Error('TCP Connection timed out')); | ||
@@ -65,7 +57,3 @@ }); | ||
catch (error) { | ||
this.address = undefined; | ||
if (this.socket) { | ||
this.socket.removeAllListeners(); | ||
this.socket = undefined; | ||
} | ||
this.closeSocket(true); | ||
reject(error); | ||
@@ -75,4 +63,7 @@ } | ||
} | ||
destroy() { | ||
this.platform.log.debug(this.constructor.name, 'destroy'); | ||
closeSocket(clearAddress) { | ||
this.platform.log.debug(this.constructor.name, 'closeSocket'); | ||
if (clearAddress) { | ||
this.address = undefined; | ||
} | ||
if (this.socket) { | ||
@@ -82,2 +73,8 @@ this.socket.removeAllListeners(); | ||
this.socket = undefined; | ||
} | ||
} | ||
destroy() { | ||
this.platform.log.debug(this.constructor.name, 'destroy'); | ||
if (this.socket) { | ||
this.closeSocket(false); | ||
this.platform.log.info('TCP Connection: Closed'); | ||
@@ -84,0 +81,0 @@ } |
{ | ||
"displayName": "Rinnai Touch Platform", | ||
"name": "homebridge-rinnai-touch-platform", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "Homebridge Plugin to control heating/cooling via a Rinnai Touch WiFi Module", | ||
@@ -19,2 +19,6 @@ "license": "Apache-2.0", | ||
"main": "dist/index.js", | ||
"funding": { | ||
"type": "paypal", | ||
"url": "https://paypal.me/Mantorok1" | ||
}, | ||
"scripts": { | ||
@@ -49,5 +53,5 @@ "lint": "eslint src/**.ts", | ||
"devDependencies": { | ||
"@types/node": "^14.6.0", | ||
"@typescript-eslint/eslint-plugin": "^3.9.1", | ||
"@typescript-eslint/parser": "^3.9.1", | ||
"@types/node": "^14.6.2", | ||
"@typescript-eslint/eslint-plugin": "^3.10.1", | ||
"@typescript-eslint/parser": "^3.10.1", | ||
"eslint": "^7.7.0", | ||
@@ -57,5 +61,5 @@ "homebridge": "^1.1.2", | ||
"rimraf": "^3.0.2", | ||
"ts-node": "^8.10.2", | ||
"typescript": "^3.9.7" | ||
"ts-node": "^9.0.0", | ||
"typescript": "^4.0.2" | ||
} | ||
} |
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
296943
3597