sync tag and id, add RC30 vacation #1712

This commit is contained in:
MichaelDvP
2024-05-03 08:31:20 +02:00
parent d056846eb0
commit 3a772a0dbf
16 changed files with 210 additions and 172 deletions

View File

@@ -635,7 +635,7 @@ void EMSESP::publish_device_values(uint8_t device_type) {
bool nested = (Mqtt::is_nested());
// group by device type
for (uint8_t tag = DeviceValueTAG::TAG_DEVICE_DATA; tag <= DeviceValueTAG::TAG_HS16; tag++) {
for (int8_t tag = DeviceValueTAG::TAG_DEVICE_DATA; tag <= DeviceValueTAG::TAG_HS16; tag++) {
JsonObject json_tag = json;
bool nest_created = false;
for (const auto & emsdevice : emsdevices) {
@@ -647,7 +647,7 @@ void EMSESP::publish_device_values(uint8_t device_type) {
need_publish |= emsdevice->generate_values(json_tag, tag, false, EMSdevice::OUTPUT_TARGET::MQTT);
}
}
if (need_publish && (!nested && tag >= DeviceValueTAG::TAG_DEVICE_DATA)) {
if (need_publish && !nested) {
Mqtt::queue_publish(Mqtt::tag_to_topic(device_type, tag), json);
json = doc.to<JsonObject>();
need_publish = false;