Update node-intellicenter, log timeouts
All checks were successful
Node.js CI / build (18.x) (push) Successful in 18s
Node.js CI / build (20.x) (push) Successful in 5s
Node.js CI / build (22.x) (push) Successful in 6s

This commit is contained in:
2025-01-08 21:23:05 -06:00
parent 96f626254d
commit 254c3cad31
3 changed files with 18 additions and 19 deletions

View File

@ -166,29 +166,28 @@ module.exports = NodeHelper.create({
Log.info("[MMM-IntelliCenter] initial connection to unit...");
initialConnectDone = false;
const reset = () => {
reconnectCb();
this.resetFoundUnit();
unitReconnectTimer = setTimeout(() => {
this.connect(cb, reconnectCb);
}, reconnectDelayMs);
};
foundUnit
.on("error", (e) => {
Log.error(
`[MMM-IntelliCenter] error in unit connection. restarting the connection process in ${reconnectDelayMs / 1000} seconds`,
);
Log.error("[MMM-IntelliCenter] error in unit connection.");
Log.error(e);
reconnectCb();
this.resetFoundUnit();
unitReconnectTimer = setTimeout(() => {
this.connect(cb, reconnectCb);
}, reconnectDelayMs);
})
.on("close", () => {
Log.error(
`[MMM-IntelliCenter] unit connection closed unexpectedly. restarting the connection process in ${reconnectDelayMs / 1000} seconds`,
);
reconnectCb();
this.resetFoundUnit();
unitReconnectTimer = setTimeout(() => {
this.connect(cb, reconnectCb);
}, reconnectDelayMs);
reset();
})
.on("timeout", () => {
Log.error("[MMM-IntelliCenter] unit connection timed out.");
})
.on("notify", (msg) => {
for (const obj of msg.objectList) {

8
package-lock.json generated
View File

@ -9,7 +9,7 @@
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"node-intellicenter": "^0.2.0"
"node-intellicenter": "^0.2.2"
},
"devDependencies": {
"@eslint/js": "^9.17.0",
@ -2380,9 +2380,9 @@
}
},
"node_modules/node-intellicenter": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/node-intellicenter/-/node-intellicenter-0.2.0.tgz",
"integrity": "sha512-kVDsKHe6xKGquiM1689PSUsMDK0SwB+JNYWr/TNaiH0WTodtgZMP3pjZUHfNNmknB/T1GEUt/17SODNYUcunAg==",
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/node-intellicenter/-/node-intellicenter-0.2.2.tgz",
"integrity": "sha512-jUtIXfLvuofH4tPq3ft1Ycl67rmqfOsUihztprXqoGtLy7qXOR5+TbeKjDXynQ2qTdZ7I8amWWa90rm5j19sbg==",
"license": "MIT",
"dependencies": {
"debug": "^4.4.0",

View File

@ -7,7 +7,7 @@
"repository": "https://github.com/parnic/MMM-IntelliCenter.git",
"license": "MIT",
"dependencies": {
"node-intellicenter": "^0.2.0"
"node-intellicenter": "^0.2.2"
},
"devDependencies": {
"@eslint/js": "^9.17.0",