mirror of
https://github.com/esphome/esphome.git
synced 2026-02-21 08:55:36 -07:00
Merge branch 'integration' into memory_api
This commit is contained in:
@@ -35,9 +35,7 @@ void Rtttl::dump_config() {
|
||||
|
||||
void Rtttl::play(std::string rtttl) {
|
||||
if (this->state_ != State::STATE_STOPPED && this->state_ != State::STATE_STOPPING) {
|
||||
int pos = this->rtttl_.find(':');
|
||||
auto name = this->rtttl_.substr(0, pos);
|
||||
ESP_LOGW(TAG, "Already playing: %s", name.c_str());
|
||||
ESP_LOGW(TAG, "Already playing: %.*s", (int) this->rtttl_.find(':'), this->rtttl_.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,8 +57,7 @@ void Rtttl::play(std::string rtttl) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto name = this->rtttl_.substr(0, this->position_);
|
||||
ESP_LOGD(TAG, "Playing song %s", name.c_str());
|
||||
ESP_LOGD(TAG, "Playing song %.*s", (int) this->position_, this->rtttl_.c_str());
|
||||
|
||||
// get default duration
|
||||
this->position_ = this->rtttl_.find("d=", this->position_);
|
||||
|
||||
Reference in New Issue
Block a user