Skip to content

Commit

Permalink
fix(miio): Add proper shutdown methods to dummycloud and retrywrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Aug 29, 2021
1 parent 4d3f4ac commit f0676ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 0 additions & 3 deletions backend/lib/core/ValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ class ValetudoRobot {
}


/**
* @abstract
*/
async shutdown() {

}
Expand Down
4 changes: 4 additions & 0 deletions backend/lib/miio/RetryWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ class RetryWrapper {
return this.sendMessage(method, args, options);
}
}

async shutdown() {
await this.miioSocket.shutdown();
}
}

module.exports = RetryWrapper;
5 changes: 5 additions & 0 deletions backend/lib/robots/MiioValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,11 @@ class MiioValetudoRobot extends ValetudoRobot {
Logger.info("LocalSecret " + this.localSecret);
}

async shutdown() {
await super.shutdown();
await this.dummyCloud.shutdown();
await this.localSocket.shutdown();
}

static READ_DEVICE_CONF(path) {
let deviceConf;
Expand Down

0 comments on commit f0676ef

Please sign in to comment.