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();
|
doc.clear();
|
||||||
JsonObject rootSM = doc.to<JsonObject>();
|
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;
|
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;
|
rootSM[SM_BOTTOMTEMP] = (double)EMS_Other.SMbottomTemp / 10;
|
||||||
|
|
||||||
if (EMS_Other.SMpumpModulation != EMS_VALUE_INT_NOTSET)
|
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);
|
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;
|
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;
|
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;
|
rootSM[SM_ENERGYTOTAL] = (double)EMS_Other.SMEnergyTotal / 10;
|
||||||
|
|
||||||
data[0] = '\0'; // reset data for next package
|
data[0] = '\0'; // reset data for next package
|
||||||
|
|||||||
@@ -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) {
|
char * ems_getThermostatDescription(char * buffer) {
|
||||||
uint8_t size = 128;
|
uint8_t size = 128;
|
||||||
|
|||||||
Reference in New Issue
Block a user