Skip to content

Commit

Permalink
Reset after reading/writing actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Feb 15, 2025
1 parent 69cfb62 commit 5130b23
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/tc_bus/tc_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ namespace esphome
this->cancel_timeout("wait_for_memory_reading");
reading_memory_ = false;

send_command(COMMAND_TYPE_RESET);

this->publish_settings();
this->read_memory_complete_callback_.call(memory_buffer_);
} else {
Expand All @@ -206,6 +208,8 @@ namespace esphome
this->cancel_timeout("wait_for_identification_category_0");
this->cancel_timeout("wait_for_identification_category_1");

send_command(COMMAND_TYPE_RESET);

ModelData device;
device.category = 0;
device.memory_size = 0;
Expand Down Expand Up @@ -771,6 +775,9 @@ namespace esphome
// Failed
this->identify_model_ = false;
this->identify_timeout_callback_.call();

send_command(COMMAND_TYPE_RESET);

ESP_LOGE(TAG, "Identification response not received in time. The device model may not support identification.");
});
});
Expand Down Expand Up @@ -817,6 +824,8 @@ namespace esphome
reading_memory_count_ = 0;
reading_memory_max_ = 0;

send_command(COMMAND_TYPE_RESET);

this->read_memory_timeout_callback_.call();
ESP_LOGE(TAG, "Memory block not received in time. Reading canceled!");
});
Expand Down

0 comments on commit 5130b23

Please sign in to comment.