refactor: not initialize Bluetooth if BLE sensors are not used

This commit is contained in:
Yurii
2025-10-03 20:56:04 +03:00
parent d3e7a13e1f
commit 9d77256051

View File

@@ -405,7 +405,6 @@ protected:
#if USE_BLE
void cleanBleInstances() {
#if USE_BLE
if (!NimBLEDevice::isInitialized()) {
return;
}
@@ -442,10 +441,13 @@ protected:
NimBLEDevice::deleteClient(client);
}
}
#endif
}
void pollingBleSensors() {
if (!Sensors::getAmountByType(Sensors::Type::BLUETOOTH, true)) {
return;
}
if (!NimBLEDevice::isInitialized() && millis() > 5000) {
Log.sinfoln(FPSTR(L_SENSORS_BLE), F("Initialized"));
BLEDevice::init("");