mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix count of temp sensors - #2756
This commit is contained in:
@@ -115,9 +115,10 @@ class TemperatureSensor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t count_entities(bool exclude_disabled_system = false) const {
|
size_t count_entities(bool exclude_disabled_system = false) const {
|
||||||
return std::count_if(sensors_.begin(), sensors_.end(), [exclude_disabled_system](const Sensor & sensor) {
|
if (exclude_disabled_system) {
|
||||||
return exclude_disabled_system ? !sensor.is_system() : sensor.is_system();
|
return std::count_if(sensors_.begin(), sensors_.end(), [](const Sensor & sensor) { return !sensor.is_system(); });
|
||||||
});
|
}
|
||||||
|
return sensors_.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool update(const std::string & id, const std::string & name, int16_t offset, bool is_system);
|
bool update(const std::string & id, const std::string & name, int16_t offset, bool is_system);
|
||||||
|
|||||||
Reference in New Issue
Block a user