mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix, attempt #3
This commit is contained in:
@@ -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) {
|
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) {
|
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);
|
type_name = emsdevice->telegram_type_name(telegram);
|
||||||
if (!type_name.empty()) {
|
if (!type_name.empty()) {
|
||||||
break;
|
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 we can't find names for the devices, use their hex values
|
||||||
if (src_name.empty()) {
|
if (src_name.empty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user