1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 13:13:50 +00:00

[Modbus_controller] Fix duplicate cmd check (#3031)

This commit is contained in:
Martin
2022-01-12 04:38:13 +01:00
committed by GitHub
parent 5026bc7a78
commit 56547b3d50

View File

@@ -109,7 +109,7 @@ void ModbusController::queue_command(const ModbusCommandItem &command) {
// not very effective but the queue is never really large
for (auto &item : command_queue_) {
if (item->register_address == command.register_address && item->register_count == command.register_count &&
item->register_type == command.register_type) {
item->register_type == command.register_type && item->function_code == command.function_code) {
ESP_LOGW(TAG, "Duplicate modbus command found");
// update the payload of the queued command
// replaces a previous command