From c7b1631b44e78ed2565a250ecfc7fc1c2cf584ac Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 7 Oct 2023 18:24:55 +0100 Subject: [PATCH] extra pin config --- components/BalboaGL/ESPBalboaGL.cpp | 15 ++++++++++++--- components/BalboaGL/ESPBalboaGL.h | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/components/BalboaGL/ESPBalboaGL.cpp b/components/BalboaGL/ESPBalboaGL.cpp index 97611ee..af86bff 100644 --- a/components/BalboaGL/ESPBalboaGL.cpp +++ b/components/BalboaGL/ESPBalboaGL.cpp @@ -447,17 +447,26 @@ void BalboaGL::setup() { // return ESPMHP_MIN_TEMPERATURE + (steps * ESPMHP_TEMPERATURE_STEP); // } -// void BalboaGL::dump_config() { -// this->banner(); +void BalboaGL::dump_config() { + // this->banner(); + ESP_LOGI(TAG, " rx,tx = %u,%u", this->rx_pin, this->tx_pin); // ESP_LOGI(TAG, " Supports HEAT: %s", YESNO(true)); // ESP_LOGI(TAG, " Supports COOL: %s", YESNO(true)); // ESP_LOGI(TAG, " Supports AWAY mode: %s", YESNO(false)); // ESP_LOGI(TAG, " Saved heat: %.1f", heat_setpoint.value_or(-1)); // ESP_LOGI(TAG, " Saved cool: %.1f", cool_setpoint.value_or(-1)); // ESP_LOGI(TAG, " Saved auto: %.1f", auto_setpoint.value_or(-1)); -// } +} // void BalboaGL::dump_state() { // LOG_CLIMATE("", "BalboaGL Climate", this); // ESP_LOGI(TAG, "HELLO"); // } + +void void BalboaGL::set_rx_pin(int pin) { + this->rx_pin = pin; +} + +void void BalboaGL::set_tx_pin(int pin) { + this->tx_pin = pin; +} diff --git a/components/BalboaGL/ESPBalboaGL.h b/components/BalboaGL/ESPBalboaGL.h index 4020cfb..97b05ca 100644 --- a/components/BalboaGL/ESPBalboaGL.h +++ b/components/BalboaGL/ESPBalboaGL.h @@ -42,8 +42,8 @@ class BalboaGL : public PollingComponent, public climate::Climate { HardwareSerial* hw_serial ); - // // print the current configuration - // void dump_config() override; + // print the current configuration + void dump_config() override; // // handle a change in settings as detected by the HeatPump library. // void hpSettingsChanged(); @@ -51,16 +51,16 @@ class BalboaGL : public PollingComponent, public climate::Climate { // // Handle a change in status as detected by the HeatPump library. // void hpStatusChanged(heatpumpStatus currentStatus); - // // Set up the component, initializing the balboaGL object. + // Set up the component, initializing the balboaGL object. void setup() override; - // // This is called every poll_interval. + // This is called every poll_interval. void update() override; - // // Configure the climate object with traits that we support. + // Configure the climate object with traits that we support. climate::ClimateTraits traits() override; - // // Get a mutable reference to the traits that we support. + // Get a mutable reference to the traits that we support. climate::ClimateTraits& config_traits(); // Debugging function to print the object's state. @@ -73,6 +73,9 @@ class BalboaGL : public PollingComponent, public climate::Climate { // // set_remote_temp(0) to switch back to the internal sensor. // void set_remote_temperature(float); + void set_rx_pin(int pin); + + void set_tx_pin(int pin); protected: // The ClimateTraits supported by this HeatPump. @@ -87,6 +90,9 @@ class BalboaGL : public PollingComponent, public climate::Climate { //ESP8266 or UART0 on ESP32 void check_logger_conflict_(); + int rx_pin; + int tx_pin; + private: // Retrieve the HardwareSerial pointer from friend and subclasses. HardwareSerial *hw_serial_;