Skip to content

Commit

Permalink
Monitor all temperature sensors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kimble4 authored Oct 25, 2024
1 parent 966e5bb commit f001313
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/evse_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f001313

Please sign in to comment.