mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-13 19:29:55 +03:00
updated gpio test logic
This commit is contained in:
@@ -118,7 +118,6 @@ class AnalogSensor {
|
||||
~AnalogSensor() = default;
|
||||
|
||||
enum AnalogType : int8_t {
|
||||
NOTUSED = 0, // 0 = disabled
|
||||
DIGITAL_IN = 1,
|
||||
COUNTER = 2,
|
||||
ADC = 3,
|
||||
@@ -164,12 +163,10 @@ class AnalogSensor {
|
||||
return (!sensors_.empty());
|
||||
}
|
||||
|
||||
// count number of items in sensors_ where type is not set to disabled and not a system sensor
|
||||
size_t count_entities(bool exclude_disabled_system = false) const {
|
||||
if (exclude_disabled_system) {
|
||||
// count number of items in sensors_ where type is not set to disabled and not a system sensor
|
||||
return std::count_if(sensors_.begin(), sensors_.end(), [](const Sensor & sensor) {
|
||||
return sensor.type() != AnalogSensor::AnalogType::NOTUSED && !sensor.is_system();
|
||||
});
|
||||
return std::count_if(sensors_.begin(), sensors_.end(), [](const Sensor & sensor) { return !sensor.is_system(); });
|
||||
}
|
||||
return sensors_.size();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user