From 1c65a7cabaf10e8f842d337859fc057703356383 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 23 Nov 2025 14:46:57 +0100 Subject: [PATCH] fix count of temp sensors - #2756 --- src/core/temperaturesensor.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/temperaturesensor.h b/src/core/temperaturesensor.h index f754e3a14..01451221a 100644 --- a/src/core/temperaturesensor.h +++ b/src/core/temperaturesensor.h @@ -115,9 +115,10 @@ class TemperatureSensor { } size_t count_entities(bool exclude_disabled_system = false) const { - return std::count_if(sensors_.begin(), sensors_.end(), [exclude_disabled_system](const Sensor & sensor) { - return exclude_disabled_system ? !sensor.is_system() : sensor.is_system(); - }); + if (exclude_disabled_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);