Merge pull request #2743 from MichaelDvP/dev

fix #2726
This commit is contained in:
Proddy
2025-11-14 21:47:03 +01:00
committed by GitHub
2 changed files with 20 additions and 12 deletions

View File

@@ -1183,7 +1183,7 @@ bool EMSESP::process_telegram(std::shared_ptr<const Telegram> telegram) {
uint8_t device_found = 0; uint8_t device_found = 0;
EMSdevice * found_device = nullptr; EMSdevice * found_device = nullptr;
// Combined loop: check all conditions in a single pass // check all conditions
for (const auto & emsdevice : emsdevices) { for (const auto & emsdevice : emsdevices) {
// broadcast or send to us // broadcast or send to us
if (emsdevice->is_device_id(telegram->src) && (telegram->dest == 0 || telegram->dest == EMSbus::ems_bus_id())) { if (emsdevice->is_device_id(telegram->src) && (telegram->dest == 0 || telegram->dest == EMSbus::ems_bus_id())) {
@@ -1191,19 +1191,27 @@ bool EMSESP::process_telegram(std::shared_ptr<const Telegram> telegram) {
found_device = emsdevice.get(); found_device = emsdevice.get();
break; break;
} }
}
if (!telegram_found) {
for (const auto & emsdevice : emsdevices) {
// check for command to the device // check for command to the device
if (!telegram_found && emsdevice->is_device_id(telegram->dest) && telegram->src != EMSbus::ems_bus_id()) { if (emsdevice->is_device_id(telegram->dest) && telegram->src != EMSbus::ems_bus_id()) {
telegram_found = emsdevice->handle_telegram(telegram); telegram_found = emsdevice->handle_telegram(telegram);
found_device = emsdevice.get(); found_device = emsdevice.get();
break; break;
} }
}
}
if (!telegram_found) {
for (const auto & emsdevice : emsdevices) {
// check for sends to master thermostat // check for sends to master thermostat
if (!telegram_found && emsdevice->is_device_id(telegram->src) && telegram->dest == 0x10) { if (emsdevice->is_device_id(telegram->src) && telegram->dest == 0x10) {
telegram_found = emsdevice->handle_telegram(telegram); telegram_found = emsdevice->handle_telegram(telegram);
found_device = emsdevice.get(); found_device = emsdevice.get();
break; break;
} }
} }
}
if (found_device) { if (found_device) {
device_found = found_device->unique_id(); device_found = found_device->unique_id();

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.3-dev.28" #define EMSESP_APP_VERSION "3.7.3-dev.29"