watch_id on type can also be 7F..FF

This commit is contained in:
MichaelDvP
2020-09-10 17:13:16 +02:00
parent e99a1f0cd4
commit c10a619fbd
2 changed files with 4 additions and 8 deletions

View File

@@ -131,12 +131,7 @@ uint8_t EMSESP::actual_master_thermostat() {
// to watch both type IDs and device IDs
void EMSESP::watch_id(uint16_t watch_id) {
// if it's a device ID, which is a single byte, remove the MSB so to support both Buderus and HT3 protocols
if (watch_id <= 0xFF) {
watch_id_ = (watch_id & 0x7F);
} else {
watch_id_ = watch_id;
}
watch_id_ = watch_id;
}
// change the tx_mode
@@ -491,7 +486,8 @@ bool EMSESP::process_telegram(std::shared_ptr<const Telegram> telegram) {
LOG_NOTICE(pretty_telegram(telegram).c_str());
read_id_ = WATCH_ID_NONE;
} else if (watch() == WATCH_ON) {
if ((watch_id_ == WATCH_ID_NONE) || (telegram->src == watch_id_) || (telegram->dest == watch_id_) || (telegram->type_id == watch_id_)) {
if ((watch_id_ == WATCH_ID_NONE) || (telegram->type_id == watch_id_) ||
((watch_id_ < 0x80) && ((telegram->src == watch_id_) || (telegram->dest == watch_id_)))) {
LOG_NOTICE(pretty_telegram(telegram).c_str());
}
}