mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
fix rendering for unset SM values
This commit is contained in:
@@ -767,10 +767,10 @@ void publishValues(bool force) {
|
||||
doc.clear();
|
||||
JsonObject rootSM = doc.to<JsonObject>();
|
||||
|
||||
if (abs(EMS_Other.SMcollectorTemp) < EMS_VALUE_SHORT_NOTSET)
|
||||
if (abs(EMS_Other.SMcollectorTemp) != EMS_VALUE_SHORT_NOTSET)
|
||||
rootSM[SM_COLLECTORTEMP] = (double)EMS_Other.SMcollectorTemp / 10;
|
||||
|
||||
if (abs(EMS_Other.SMbottomTemp) < EMS_VALUE_SHORT_NOTSET)
|
||||
if (abs(EMS_Other.SMbottomTemp) != EMS_VALUE_SHORT_NOTSET)
|
||||
rootSM[SM_BOTTOMTEMP] = (double)EMS_Other.SMbottomTemp / 10;
|
||||
|
||||
if (EMS_Other.SMpumpModulation != EMS_VALUE_INT_NOTSET)
|
||||
@@ -780,13 +780,13 @@ void publishValues(bool force) {
|
||||
rootSM[SM_PUMP] = _bool_to_char(s, EMS_Other.SMpump);
|
||||
}
|
||||
|
||||
if (abs(EMS_Other.SMEnergyLastHour) < EMS_VALUE_SHORT_NOTSET)
|
||||
if (abs(EMS_Other.SMEnergyLastHour) != EMS_VALUE_SHORT_NOTSET)
|
||||
rootSM[SM_ENERGYLASTHOUR] = (double)EMS_Other.SMEnergyLastHour / 10;
|
||||
|
||||
if (abs(EMS_Other.SMEnergyToday) < EMS_VALUE_SHORT_NOTSET)
|
||||
if (abs(EMS_Other.SMEnergyToday) != EMS_VALUE_SHORT_NOTSET)
|
||||
rootSM[SM_ENERGYTODAY] = EMS_Other.SMEnergyToday;
|
||||
|
||||
if (abs(EMS_Other.SMEnergyTotal) < EMS_VALUE_SHORT_NOTSET)
|
||||
if (abs(EMS_Other.SMEnergyTotal) != EMS_VALUE_SHORT_NOTSET)
|
||||
rootSM[SM_ENERGYTOTAL] = (double)EMS_Other.SMEnergyTotal / 10;
|
||||
|
||||
data[0] = '\0'; // reset data for next package
|
||||
|
||||
@@ -1830,6 +1830,7 @@ void ems_getOtherValues() {
|
||||
|
||||
/**
|
||||
* returns current thermostat type as a string
|
||||
* by looking up the product_id
|
||||
*/
|
||||
char * ems_getThermostatDescription(char * buffer) {
|
||||
uint8_t size = 128;
|
||||
|
||||
Reference in New Issue
Block a user