1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-07 13:40:59 +00:00

[rotary_encoder] clang-tidy fixes for #7822 (#7880)

This commit is contained in:
Keith Burzinski 2024-11-27 16:21:10 -06:00 committed by GitHub
parent 4da57c35d0
commit 567256bd62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,7 +162,7 @@ void RotaryEncoderSensor::dump_config() {
LOG_PIN(" Pin B: ", this->pin_b_); LOG_PIN(" Pin B: ", this->pin_b_);
LOG_PIN(" Pin I: ", this->pin_i_); LOG_PIN(" Pin I: ", this->pin_i_);
const LogString *restore_mode = LOG_STR(""); const LogString *restore_mode;
switch (this->restore_mode_) { switch (this->restore_mode_) {
case ROTARY_ENCODER_RESTORE_DEFAULT_ZERO: case ROTARY_ENCODER_RESTORE_DEFAULT_ZERO:
restore_mode = LOG_STR("Restore (Defaults to zero)"); restore_mode = LOG_STR("Restore (Defaults to zero)");
@ -170,6 +170,8 @@ void RotaryEncoderSensor::dump_config() {
case ROTARY_ENCODER_ALWAYS_ZERO: case ROTARY_ENCODER_ALWAYS_ZERO:
restore_mode = LOG_STR("Always zero"); restore_mode = LOG_STR("Always zero");
break; break;
default:
restore_mode = LOG_STR("");
} }
ESP_LOGCONFIG(TAG, " Restore Mode: %s", LOG_STR_ARG(restore_mode)); ESP_LOGCONFIG(TAG, " Restore Mode: %s", LOG_STR_ARG(restore_mode));