fix rendering for unset SM values

This commit is contained in:
proddy
2019-06-19 14:41:05 +02:00
parent 1171608d33
commit f320095034
2 changed files with 7 additions and 6 deletions

View File

@@ -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

View File

@@ -1829,7 +1829,8 @@ void ems_getOtherValues() {
}
/**
* returns current thermostat type as a string
* returns current thermostat type as a string
* by looking up the product_id
*/
char * ems_getThermostatDescription(char * buffer) {
uint8_t size = 128;