From 289aedcfe21c54352ab8da8858d74d5828620287 Mon Sep 17 00:00:00 2001 From: Colm Date: Wed, 2 Jul 2025 05:23:37 -0700 Subject: [PATCH] Don't compile `state_to_string()` unless debugging. (#7473) --- esphome/components/rtttl/rtttl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/rtttl/rtttl.cpp b/esphome/components/rtttl/rtttl.cpp index 2c4a0f917f..65a3af1bbc 100644 --- a/esphome/components/rtttl/rtttl.cpp +++ b/esphome/components/rtttl/rtttl.cpp @@ -371,6 +371,7 @@ void Rtttl::finish_() { ESP_LOGD(TAG, "Playback finished"); } +#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG static const LogString *state_to_string(State state) { switch (state) { case STATE_STOPPED: @@ -387,6 +388,7 @@ static const LogString *state_to_string(State state) { return LOG_STR("UNKNOWN"); } }; +#endif void Rtttl::set_state_(State state) { State old_state = this->state_;