info shows shortnames, only valid hcs

This commit is contained in:
MichaelDvP
2021-05-05 18:48:07 +02:00
parent 32f477726b
commit 7f52ef8bd8
4 changed files with 21 additions and 41 deletions

View File

@@ -984,14 +984,16 @@ bool EMSESP::command_info(uint8_t device_type, JsonObject & json, const int8_t i
tag = DeviceValueTAG::TAG_HC1 + id - 1;
} else if (id >= 9 && id <= 10) {
tag = DeviceValueTAG::TAG_WWC1 + id - 9;
} else {
} else if (id == -1) {
tag = DeviceValueTAG::TAG_NONE;
} else {
return false;
}
for (const auto & emsdevice : emsdevices) {
if (emsdevice && (emsdevice->device_type() == device_type)
&& ((device_type != DeviceType::THERMOSTAT) || (emsdevice->device_id() == EMSESP::actual_master_thermostat()))) {
has_value |= emsdevice->generate_values_json(json, tag, (id < 1), (id == -1)); // nested for id -1,0 & console for id -1
has_value |= emsdevice->generate_values_json(json, tag, (id == -1), false); // nested for id -1,0 & console for id -1
}
}