Skip to content

Commit

Permalink
add 400ms delay when sending parts to same bus-type-id
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Nov 22, 2024
1 parent d810441 commit 7dd32f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/devices/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3531,10 +3531,10 @@ bool Thermostat::set_switchtimes(const char * value, const uint16_t type_id, uin
offset += 2;
}
// write all 84 bytes, split even to have the 2 bytes switchpoint in one telegram part
write_command(type_id, 72, &switchtimes[72], 12, type_id);
write_command(type_id, 48, &switchtimes[48], 24, type_id);
write_command(type_id, 24, &switchtimes[24], 24, type_id);
write_command(type_id, 0, switchtimes, 24, type_id);
write_command(type_id, 72, &switchtimes[72], 12, 0);
write_command(type_id, 48, &switchtimes[48], 24, 0);
write_command(type_id, 24, &switchtimes[24], 24, 0);
write_command(type_id, 0, switchtimes, 24, 0);
return true;
}
// set a single switchpoint
Expand Down
4 changes: 4 additions & 0 deletions src/emsesp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ void EMSESP::dump_all_telegrams(uuid::console::Shell & shell) {
device_id = 0x40; // dhw 1
}
}
// For a Mixer, fix device_id to 0x20 to give us telegram-type-ids for hc1
if (device.device_type == DeviceType::MIXER) {
device_id = 0x20; // hc
}

// add the device and print out all the entities
emsdevices.push_back(
Expand Down
3 changes: 2 additions & 1 deletion src/telegram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,9 @@ uint16_t TxService::post_send_query() {
set_post_send_query(0); // reset
// delay the request if we have a different type_id for post_send_query
delayed_send_ = (this->telegram_last_->type_id == post_typeid) ? 0 : (uuid::get_uptime() + POST_SEND_DELAY);
} else if (!tx_telegrams_.empty() && this->telegram_last_->type_id == tx_telegrams_.front().telegram_->type_id && tx_telegrams_.front().telegram_->operation == Telegram::Operation::TX_WRITE) {
delayed_send_ = 400;
}

return post_typeid;
}

Expand Down

0 comments on commit 7dd32f9

Please sign in to comment.