TAG_DEVICE_DATA_WW is only for BOILER

This commit is contained in:
proddy
2021-06-08 18:24:06 +02:00
parent 07a943eedf
commit cc30e09e4b
4 changed files with 26 additions and 6 deletions

View File

@@ -460,8 +460,8 @@ void EMSESP::publish_device_values(uint8_t device_type) {
Mqtt::publish(Mqtt::tag_to_topic(device_type, DeviceValueTAG::TAG_BOILER_DATA), json);
}
doc.clear();
if (emsdevice->generate_values_json(json, DeviceValueTAG::TAG_DEVICE_DATA_WW, false)) {
Mqtt::publish(Mqtt::tag_to_topic(device_type, DeviceValueTAG::TAG_DEVICE_DATA_WW), json);
if (emsdevice->generate_values_json(json, DeviceValueTAG::TAG_BOILER_DATA_WW, false)) {
Mqtt::publish(Mqtt::tag_to_topic(device_type, DeviceValueTAG::TAG_BOILER_DATA_WW), json);
}
need_publish = false;
}
@@ -561,6 +561,7 @@ void EMSESP::publish_response(std::shared_ptr<const Telegram> telegram) {
Mqtt::publish(F_(response), doc.as<JsonObject>());
}
// builds json with the detail of each value, for all device types and the dallas sensor
bool EMSESP::get_device_value_info(JsonObject & root, const char * cmd, const int8_t id, const uint8_t devicetype) {
for (const auto & emsdevice : emsdevices) {
if (emsdevice->device_type() == devicetype) {