Skip to content

Commit 4749a56

Browse files
angeloINTJclaude
andcommitted
fix: top panel S10 min/max was showing S0 data
Condition 'topIdx < 10' in updateLiveDisplay() excluded slot 10 from getting its own min/max values. Fallback used sMinT/sMaxT from the current slot (_currentSensorIdx) instead of S10's cached values. Changed to 'topIdx <= 10' so S10 (DHT22 on GPIO 10) gets correct min/max from _cachedMin[10]/_cachedMax[10]/_cachedHumMin[10]/_cachedHumMax[10]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4868fb7 commit 4749a56

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/AppManager_HistoryAlarm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void AppManager::updateLiveDisplay( ) {
183183
_displayMgr->setSlotMinMax(sMinT, sMaxT, sMinH, sMaxH);
184184
/* Top slot min/max — may differ from _currentSensorIdx when fixed */
185185
int topIdx = _displayMgr->getTopSlotIdx( );
186-
if (topIdx >= 0 && topIdx < 10 && topIdx != slotIdx) {
186+
if (topIdx >= 0 && topIdx <= 10 && topIdx != slotIdx) {
187187
float tMinT = (_cachedMin[topIdx] < 999.0f) ? _cachedMin[topIdx] : NAN;
188188
float tMaxT = (_cachedMax[topIdx] > -999.0f) ? _cachedMax[topIdx] : NAN;
189189
float tMinH = (_cachedHumMin[topIdx] < 999.0f) ? _cachedHumMin[topIdx] : NAN;

0 commit comments

Comments
 (0)