From f001313fd20cca8a186b9268c863f420db95c24e Mon Sep 17 00:00:00 2001 From: Kim Wall <30846798+kimble4@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:34:10 +0100 Subject: [PATCH] Monitor all temperature sensors Sets `_temps[EVSE_MONITOR_TEMP_MONITOR]` and `_temps[EVSE_MONITOR_TEMP_MAX]` using the temperature sensor with the highest reading, rather than always using the first sensor with a valid reading. --- src/evse_monitor.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/evse_monitor.cpp b/src/evse_monitor.cpp index 2c020d61..3c2989fb 100644 --- a/src/evse_monitor.cpp +++ b/src/evse_monitor.cpp @@ -778,11 +778,14 @@ void EvseMonitor::getTemperatureFromEvse() if(_temps[i].isValid()) { double temp = _temps[i].get(); - _temps[EVSE_MONITOR_TEMP_MONITOR].set(temp); - if(temp > _temps[EVSE_MONITOR_TEMP_MAX].get()) { + if(!_temps[EVSE_MONITOR_TEMP_MONITOR].isValid() || temp > _temps[EVSE_MONITOR_TEMP_MONITOR].get()) + { + _temps[EVSE_MONITOR_TEMP_MONITOR].set(temp); + } + if(temp > _temps[EVSE_MONITOR_TEMP_MAX].get()) + { _temps[EVSE_MONITOR_TEMP_MAX].set(temp); } - break; } } _data_ready.ready(EVSE_MONITOR_TEMP_DATA_READY);