refactor: optimized polling of unused OT IDs

This commit is contained in:
Yurii committed 2024-11-16 22:57:52 +03:00
1 parent 2bb771a4a7
commit 2589020428
2 files changed
+21 -21

No files matched your search

+2 -2
View File
@@ -122,14 +122,14 @@ public:
return true;
}
static uint8_t getAmountByType(Type type) {
static uint8_t getAmountByType(Type type, bool onlyEnabled = false) {
if (settings == nullptr) {
return 0;
}
uint8_t amount = 0;
for (uint8_t id = 0; id < getMaxSensorId(); id++) {
if (settings[id].type == type) {
if (settings[id].type == type && (!onlyEnabled || settings[id].enabled)) {
amount++;
}
}