fix, attempt #3

This commit is contained in:
proddy
2025-11-06 18:29:39 +01:00
parent 9179127bce
commit c9bc18cf4b

View File

@@ -917,10 +917,12 @@ std::string EMSESP::pretty_telegram(std::shared_ptr<const Telegram> telegram) {
}
}
// Fallback for type name if not found - try dest
// Fallback for type name if not found - try src first, then dest
if (!type_found && telegram->operation != Telegram::Operation::RX_READ) {
for (int i = 0; i < 2 && type_name.empty(); ++i) {
uint8_t check_id = (i == 0) ? src : dest;
for (const auto & emsdevice : emsdevices) {
if (emsdevice->is_device_id(dest)) {
if (emsdevice->is_device_id(check_id)) {
type_name = emsdevice->telegram_type_name(telegram);
if (!type_name.empty()) {
break;
@@ -928,6 +930,7 @@ std::string EMSESP::pretty_telegram(std::shared_ptr<const Telegram> telegram) {
}
}
}
}
// if we can't find names for the devices, use their hex values
if (src_name.empty()) {