From e518537625647a9188b520a94b54e0ef2792f141 Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Fri, 25 Oct 2024 21:44:36 +0200 Subject: [PATCH] fix leftover code, --- esphome/components/rtttl/rtttl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/rtttl/rtttl.cpp b/esphome/components/rtttl/rtttl.cpp index 9e93808f56..89cd93d606 100644 --- a/esphome/components/rtttl/rtttl.cpp +++ b/esphome/components/rtttl/rtttl.cpp @@ -40,7 +40,7 @@ void Rtttl::dump_config() { } void Rtttl::play(std::string rtttl) { - if (this->state_ != State::STATE_STOPPED && this->state_ != State::STATE_STOPPING) { + if (this->state_ != State::STATE_STOPPED) { int pos = this->rtttl_.find(':'); auto name = this->rtttl_.substr(0, pos); ESP_LOGW(TAG, "RTTTL Component is already playing: %s", name.c_str()); @@ -141,7 +141,7 @@ void Rtttl::stop() { if (this->speaker_->is_running()) { this->speaker_->stop(); } - this->set_state_(STATE_STOPPING); + this->set_state_(STATE_STOPPED); } #endif this->note_duration_ = 0;