fix leftover code,

This commit is contained in:
NP v/d Spek 2024-10-25 21:44:36 +02:00
parent 3949889f60
commit e518537625

View file

@ -40,7 +40,7 @@ void Rtttl::dump_config() {
} }
void Rtttl::play(std::string rtttl) { 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(':'); int pos = this->rtttl_.find(':');
auto name = this->rtttl_.substr(0, pos); auto name = this->rtttl_.substr(0, pos);
ESP_LOGW(TAG, "RTTTL Component is already playing: %s", name.c_str()); ESP_LOGW(TAG, "RTTTL Component is already playing: %s", name.c_str());
@ -141,7 +141,7 @@ void Rtttl::stop() {
if (this->speaker_->is_running()) { if (this->speaker_->is_running()) {
this->speaker_->stop(); this->speaker_->stop();
} }
this->set_state_(STATE_STOPPING); this->set_state_(STATE_STOPPED);
} }
#endif #endif
this->note_duration_ = 0; this->note_duration_ = 0;