Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposes load_settings to UARTComponent class #5920

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions esphome/components/uart/uart_component.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class UARTComponent {
UARTParityOptions get_parity() const { return this->parity_; }
void set_baud_rate(uint32_t baud_rate) { baud_rate_ = baud_rate; }
uint32_t get_baud_rate() const { return baud_rate_; }
#ifdef USE_ESP32
virtual void load_settings() = 0;
virtual void load_settings(bool dump_config) = 0;
#endif // USE_ESP32

#ifdef USE_UART_DEBUGGER
void add_debug_callback(std::function<void(UARTDirection, uint8_t)> &&callback) {
Expand Down
3 changes: 2 additions & 1 deletion esphome/components/uart/uart_component_esp32_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class ESP32ArduinoUARTComponent : public UARTComponent, public Component {
*
* This will load the current UART interface with the latest settings (baud_rate, parity, etc).
*/
void load_settings(bool dump_config = true);
void load_settings(bool dump_config) override;
void load_settings() override { this->load_settings(true); }

protected:
void check_logger_conflict() override;
Expand Down
3 changes: 2 additions & 1 deletion esphome/components/uart/uart_component_esp_idf.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class IDFUARTComponent : public UARTComponent, public Component {
*
* This will load the current UART interface with the latest settings (baud_rate, parity, etc).
*/
void load_settings(bool dump_config = true);
void load_settings(bool dump_config) override;
void load_settings() override { this->load_settings(true); }

protected:
void check_logger_conflict() override;
Expand Down