Skip to content

Commit

Permalink
Add missing dump config entry
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Feb 2, 2025
1 parent 620c310 commit 1e73b75
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
3 changes: 2 additions & 1 deletion components/heltec_balancer_ble/heltec_balancer_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ uint8_t crc(const uint8_t data[], const uint16_t len) {

void HeltecBalancerBle::dump_config() { // NOLINT(google-readability-function-size,readability-function-size)
ESP_LOGCONFIG(TAG, "HeltecBalancerBle");
LOG_BINARY_SENSOR("", "Balancing", this->balancing_binary_sensor_);
LOG_BINARY_SENSOR("", "Online Status", this->online_status_binary_sensor_);
LOG_SENSOR("", "Minimum Cell Voltage", this->min_cell_voltage_sensor_);
LOG_SENSOR("", "Maximum Cell Voltage", this->max_cell_voltage_sensor_);
LOG_SENSOR("", "Minimum Voltage Cell", this->min_voltage_cell_sensor_);
Expand Down Expand Up @@ -144,7 +146,6 @@ void HeltecBalancerBle::dump_config() { // NOLINT(google-readability-function-s
LOG_SENSOR("", "Total Runtime", this->total_runtime_sensor_);
LOG_TEXT_SENSOR("", "Operation Status", this->operation_status_text_sensor_);
LOG_TEXT_SENSOR("", "Total Runtime Formatted", this->total_runtime_formatted_text_sensor_);
LOG_BINARY_SENSOR("", "Balancing", this->balancing_binary_sensor_);
}

void HeltecBalancerBle::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
Expand Down
3 changes: 2 additions & 1 deletion components/jk_balancer/jk_balancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ std::string JkBalancer::error_bits_to_string_(const uint8_t mask) {
void JkBalancer::dump_config() { // NOLINT(google-readability-function-size,readability-function-size)
ESP_LOGCONFIG(TAG, "JkBalancer:");
ESP_LOGCONFIG(TAG, " Address: 0x%02X", this->address_);
LOG_BINARY_SENSOR("", "Balancing", this->balancing_binary_sensor_);
LOG_BINARY_SENSOR("", "Online Status", this->online_status_binary_sensor_);
LOG_SENSOR("", "Minimum Cell Voltage", this->min_cell_voltage_sensor_);
LOG_SENSOR("", "Maximum Cell Voltage", this->max_cell_voltage_sensor_);
LOG_SENSOR("", "Minimum Voltage Cell", this->min_voltage_cell_sensor_);
Expand Down Expand Up @@ -295,7 +297,6 @@ void JkBalancer::dump_config() { // NOLINT(google-readability-function-size,rea
LOG_SENSOR("", "Errors Bitmask", this->errors_bitmask_sensor_);
LOG_SENSOR("", "Balancer Status", this->balancer_status_sensor_);
LOG_SENSOR("", "Balancing Current", this->balancing_current_sensor_);
LOG_BINARY_SENSOR("", "Balancing", this->balancing_binary_sensor_);
LOG_TEXT_SENSOR("", "Errors", this->errors_text_sensor_);
}

Expand Down
15 changes: 8 additions & 7 deletions components/jk_bms/jk_bms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,14 @@ std::string JkBms::mode_bits_to_string_(const uint16_t mask) {
void JkBms::dump_config() { // NOLINT(google-readability-function-size,readability-function-size)
ESP_LOGCONFIG(TAG, "JkBms:");
ESP_LOGCONFIG(TAG, " Address: 0x%02X", this->address_);
LOG_BINARY_SENSOR("", "Balancing", this->balancing_binary_sensor_);
LOG_BINARY_SENSOR("", "Balancing Switch", this->balancing_switch_binary_sensor_);
LOG_BINARY_SENSOR("", "Charging", this->charging_binary_sensor_);
LOG_BINARY_SENSOR("", "Charging Switch", this->charging_switch_binary_sensor_);
LOG_BINARY_SENSOR("", "Discharging", this->discharging_binary_sensor_);
LOG_BINARY_SENSOR("", "Discharging Switch", this->discharging_switch_binary_sensor_);
LOG_BINARY_SENSOR("", "Dedicated Charger Switch", this->dedicated_charger_switch_binary_sensor_);
LOG_BINARY_SENSOR("", "Online Status", this->online_status_binary_sensor_);
LOG_SENSOR("", "Minimum Cell Voltage", this->min_cell_voltage_sensor_);
LOG_SENSOR("", "Maximum Cell Voltage", this->max_cell_voltage_sensor_);
LOG_SENSOR("", "Minimum Voltage Cell", this->min_voltage_cell_sensor_);
Expand Down Expand Up @@ -631,13 +639,6 @@ void JkBms::dump_config() { // NOLINT(google-readability-function-size,readabil
LOG_SENSOR("", "Start Current Calibration", this->start_current_calibration_sensor_);
LOG_TEXT_SENSOR("", "Manufacturer", this->manufacturer_text_sensor_);
LOG_SENSOR("", "Protocol Version", this->protocol_version_sensor_);
LOG_BINARY_SENSOR("", "Balancing", this->balancing_binary_sensor_);
LOG_BINARY_SENSOR("", "Balancing Switch", this->balancing_switch_binary_sensor_);
LOG_BINARY_SENSOR("", "Charging", this->charging_binary_sensor_);
LOG_BINARY_SENSOR("", "Charging Switch", this->charging_switch_binary_sensor_);
LOG_BINARY_SENSOR("", "Discharging", this->discharging_binary_sensor_);
LOG_BINARY_SENSOR("", "Discharging Switch", this->discharging_switch_binary_sensor_);
LOG_BINARY_SENSOR("", "Dedicated Charger Switch", this->dedicated_charger_switch_binary_sensor_);
LOG_TEXT_SENSOR("", "Total Runtime Formatted", this->total_runtime_formatted_text_sensor_);
LOG_TEXT_SENSOR("", "Errors", this->errors_text_sensor_);
}
Expand Down
11 changes: 6 additions & 5 deletions components/jk_bms_ble/jk_bms_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ uint8_t crc(const uint8_t data[], const uint16_t len) {

void JkBmsBle::dump_config() { // NOLINT(google-readability-function-size,readability-function-size)
ESP_LOGCONFIG(TAG, "JkBmsBle");
LOG_BINARY_SENSOR("", "Balancing", this->balancing_binary_sensor_);
LOG_BINARY_SENSOR("", "Precharging", this->precharging_binary_sensor_);
LOG_BINARY_SENSOR("", "Charging", this->charging_binary_sensor_);
LOG_BINARY_SENSOR("", "Discharging", this->discharging_binary_sensor_);
LOG_BINARY_SENSOR("", "Heating", this->heating_binary_sensor_);
LOG_BINARY_SENSOR("", "Online Status", this->online_status_binary_sensor_);
LOG_SENSOR("", "Minimum Cell Voltage", this->min_cell_voltage_sensor_);
LOG_SENSOR("", "Maximum Cell Voltage", this->max_cell_voltage_sensor_);
LOG_SENSOR("", "Minimum Voltage Cell", this->min_voltage_cell_sensor_);
Expand Down Expand Up @@ -128,11 +134,6 @@ void JkBmsBle::dump_config() { // NOLINT(google-readability-function-size,reada
LOG_SENSOR("", "Heating Current", this->heating_current_sensor_);
LOG_TEXT_SENSOR("", "Operation Status", this->operation_status_text_sensor_);
LOG_TEXT_SENSOR("", "Total Runtime Formatted", this->total_runtime_formatted_text_sensor_);
LOG_BINARY_SENSOR("", "Balancing", this->balancing_binary_sensor_);
LOG_BINARY_SENSOR("", "Precharging", this->precharging_binary_sensor_);
LOG_BINARY_SENSOR("", "Charging", this->charging_binary_sensor_);
LOG_BINARY_SENSOR("", "Discharging", this->discharging_binary_sensor_);
LOG_BINARY_SENSOR("", "Heating", this->heating_binary_sensor_);
}

void JkBmsBle::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
Expand Down

0 comments on commit 1e73b75

Please sign in to comment.