Skip to content

Commit 761d0d4

Browse files
authored
fix: Autoconnect scale when startup mode is brew (#280)
1 parent 3ff2095 commit 761d0d4

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/display/plugins/BLEScalePlugin.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ void BLEScalePlugin::setup(Controller *controller, PluginManager *manager) {
3131
TimemoreScalesPlugin::apply();
3232
VariaScalesPlugin::apply();
3333
this->scanner = new RemoteScalesScanner();
34+
manager->on("controller:ready", [this](Event const &) {
35+
if (this->controller->getMode() != MODE_STANDBY) {
36+
ESP_LOGI("BLEScalePlugin", "Resuming scanning");
37+
scan();
38+
active = true;
39+
}
40+
});
3441
manager->on("controller:brew:start", [this](Event const &) { onProcessStart(); });
3542
manager->on("controller:grind:start", [this](Event const &) { onProcessStart(); });
3643
manager->on("controller:mode:change", [this](Event const &event) {

0 commit comments

Comments
 (0)