fix dashboard/disabled analog sensors

This commit is contained in:
proddy
2024-10-13 09:21:56 +01:00
parent e40d01ff87
commit 55bcc4410b
2 changed files with 4 additions and 4 deletions

View File

@@ -153,8 +153,8 @@ class AnalogSensor {
return (!sensors_.empty());
}
size_t count_entities(bool count_disabled = false) const {
if (count_disabled) {
size_t count_entities(bool include_disabled = true) const {
if (!include_disabled) {
// count number of items in sensors_ where type is not set to disabled
return std::count_if(sensors_.begin(), sensors_.end(), [](const Sensor & sensor) { return sensor.type() != AnalogSensor::AnalogType::NOTUSED; });
}