supress hot water/heating displaying in web if there are no values

This commit is contained in:
proddy
2020-08-04 15:59:09 +02:00
parent b8da3dc397
commit b55e647cce

View File

@@ -78,13 +78,17 @@ void Boiler::add_context_menu() {
void Boiler::device_info(JsonArray & root) { void Boiler::device_info(JsonArray & root) {
JsonObject dataElement; JsonObject dataElement;
dataElement = root.createNestedObject(); if (Helpers::hasValue(tap_water_active_, EMS_VALUE_BOOL)) {
dataElement["name"] = F("Hot tap water"); dataElement = root.createNestedObject();
dataElement["value"] = tap_water_active_ ? F("running") : F("off"); dataElement["name"] = F("Hot tap water");
dataElement["value"] = tap_water_active_ ? F("running") : F("off");
}
dataElement = root.createNestedObject(); if (Helpers::hasValue(heating_active_, EMS_VALUE_BOOL)) {
dataElement["name"] = F("Central heating"); dataElement = root.createNestedObject();
dataElement["value"] = heating_active_ ? F("active") : F("off"); dataElement["name"] = F("Central heating");
dataElement["value"] = heating_active_ ? F("active") : F("off");
}
render_value_json(root, "", F("Selected flow temperature"), selFlowTemp_, F_(degrees)); render_value_json(root, "", F("Selected flow temperature"), selFlowTemp_, F_(degrees));
render_value_json(root, "", F("Current flow temperature"), curFlowTemp_, F_(degrees), 10); render_value_json(root, "", F("Current flow temperature"), curFlowTemp_, F_(degrees), 10);