mirror of
https://github.com/parnic/MMM-IntelliCenter.git
synced 2025-06-16 13:20:12 -05:00
Update node-intellicenter, log timeouts
This commit is contained in:
@ -166,29 +166,28 @@ module.exports = NodeHelper.create({
|
|||||||
Log.info("[MMM-IntelliCenter] initial connection to unit...");
|
Log.info("[MMM-IntelliCenter] initial connection to unit...");
|
||||||
initialConnectDone = false;
|
initialConnectDone = false;
|
||||||
|
|
||||||
|
const reset = () => {
|
||||||
|
reconnectCb();
|
||||||
|
this.resetFoundUnit();
|
||||||
|
unitReconnectTimer = setTimeout(() => {
|
||||||
|
this.connect(cb, reconnectCb);
|
||||||
|
}, reconnectDelayMs);
|
||||||
|
};
|
||||||
|
|
||||||
foundUnit
|
foundUnit
|
||||||
.on("error", (e) => {
|
.on("error", (e) => {
|
||||||
Log.error(
|
Log.error("[MMM-IntelliCenter] error in unit connection.");
|
||||||
`[MMM-IntelliCenter] error in unit connection. restarting the connection process in ${reconnectDelayMs / 1000} seconds`,
|
|
||||||
);
|
|
||||||
Log.error(e);
|
Log.error(e);
|
||||||
|
|
||||||
reconnectCb();
|
|
||||||
this.resetFoundUnit();
|
|
||||||
unitReconnectTimer = setTimeout(() => {
|
|
||||||
this.connect(cb, reconnectCb);
|
|
||||||
}, reconnectDelayMs);
|
|
||||||
})
|
})
|
||||||
.on("close", () => {
|
.on("close", () => {
|
||||||
Log.error(
|
Log.error(
|
||||||
`[MMM-IntelliCenter] unit connection closed unexpectedly. restarting the connection process in ${reconnectDelayMs / 1000} seconds`,
|
`[MMM-IntelliCenter] unit connection closed unexpectedly. restarting the connection process in ${reconnectDelayMs / 1000} seconds`,
|
||||||
);
|
);
|
||||||
|
|
||||||
reconnectCb();
|
reset();
|
||||||
this.resetFoundUnit();
|
})
|
||||||
unitReconnectTimer = setTimeout(() => {
|
.on("timeout", () => {
|
||||||
this.connect(cb, reconnectCb);
|
Log.error("[MMM-IntelliCenter] unit connection timed out.");
|
||||||
}, reconnectDelayMs);
|
|
||||||
})
|
})
|
||||||
.on("notify", (msg) => {
|
.on("notify", (msg) => {
|
||||||
for (const obj of msg.objectList) {
|
for (const obj of msg.objectList) {
|
||||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -9,7 +9,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"node-intellicenter": "^0.2.0"
|
"node-intellicenter": "^0.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.17.0",
|
"@eslint/js": "^9.17.0",
|
||||||
@ -2380,9 +2380,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-intellicenter": {
|
"node_modules/node-intellicenter": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/node-intellicenter/-/node-intellicenter-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-intellicenter/-/node-intellicenter-0.2.2.tgz",
|
||||||
"integrity": "sha512-kVDsKHe6xKGquiM1689PSUsMDK0SwB+JNYWr/TNaiH0WTodtgZMP3pjZUHfNNmknB/T1GEUt/17SODNYUcunAg==",
|
"integrity": "sha512-jUtIXfLvuofH4tPq3ft1Ycl67rmqfOsUihztprXqoGtLy7qXOR5+TbeKjDXynQ2qTdZ7I8amWWa90rm5j19sbg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.4.0",
|
"debug": "^4.4.0",
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"repository": "https://github.com/parnic/MMM-IntelliCenter.git",
|
"repository": "https://github.com/parnic/MMM-IntelliCenter.git",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"node-intellicenter": "^0.2.0"
|
"node-intellicenter": "^0.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^9.17.0",
|
"@eslint/js": "^9.17.0",
|
||||||
|
Reference in New Issue
Block a user