Skip to content

Commit

Permalink
ClearInterval bei Error und Close
Browse files Browse the repository at this point in the history
  • Loading branch information
eifel-tech committed Oct 16, 2024
1 parent 53962df commit 57c5bcb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ class CloudlessHomeconnect extends utils.Adapter {
this.handleMessage(devId, data);
});
this.eventEmitter.on("socketGracefullyClose", (devId) => {
clearInterval(this.devMap.get(devId).refreshInterval);
this.connectDevice(devId);
});
this.eventEmitter.on("socketError", (devId, e) => {
this.log.warn("Connection interrupted for device " + devId + ": " + e);
clearInterval(this.devMap.get(devId).refreshInterval);
this.setStateChanged("info.connection", { val: false, ack: true });
});
this.eventEmitter.on("socketOpen", (devId) => {
Expand Down

0 comments on commit 57c5bcb

Please sign in to comment.