Don't compile state_to_string() unless debugging. (#7473)

This commit is contained in:
Colm 2025-07-02 05:23:37 -07:00 committed by GitHub
parent 4cdc804c17
commit 289aedcfe2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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_;