1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-08 04:43:46 +01:00

[pid] Fix clang-tidy sign comparison error (#11063)

This commit is contained in:
J. Nick Koston
2025-10-06 10:20:59 -05:00
committed by GitHub
parent 646508006c
commit 4c8fc5f4e6

View File

@@ -104,7 +104,7 @@ float PIDController::weighted_average_(std::deque<float> &list, float new_value,
list.push_front(new_value);
// keep only 'samples' readings, by popping off the back of the list
while (list.size() > samples)
while (samples > 0 && list.size() > static_cast<size_t>(samples))
list.pop_back();
// calculate and return the average of all values in the list