mirror of https://github.com/esphome/esphome.git
usage of ESP_LOGD, renaming to has_stopped to is_stopped
This commit is contained in:
parent
ceb61c873d
commit
4bd22e784f
|
@ -218,7 +218,7 @@ void I2SAudioSpeaker::loop() {
|
|||
|
||||
size_t I2SAudioSpeaker::play(const uint8_t *data, size_t length) {
|
||||
if (this->state_ != speaker::STATE_RUNNING && this->state_ != speaker::STATE_STARTING) {
|
||||
esph_log_d(TAG, "Called play while speaker not running.");
|
||||
ESP_LOGD(TAG, "Called play while speaker not running.");
|
||||
return 0;
|
||||
}
|
||||
size_t remaining = length;
|
||||
|
|
|
@ -23,7 +23,7 @@ class Speaker {
|
|||
virtual bool has_buffered_data() const = 0;
|
||||
|
||||
bool is_running() const { return this->state_ == STATE_RUNNING; }
|
||||
bool has_stopped() const { return this->state_ == STATE_STOPPED; }
|
||||
bool is_stopped() const { return this->state_ == STATE_STOPPED; }
|
||||
|
||||
protected:
|
||||
State state_{STATE_STOPPED};
|
||||
|
|
|
@ -340,7 +340,7 @@ void VoiceAssistant::loop() {
|
|||
break;
|
||||
} else if (this->speaker_->is_running()) {
|
||||
this->speaker_->finish();
|
||||
} else if (this->speaker_->has_stopped()) {
|
||||
} else if (this->speaker_->is_stopped()) {
|
||||
ESP_LOGD(TAG, "Speaker has finished outputting all audio");
|
||||
this->cancel_timeout("speaker-timeout");
|
||||
this->cancel_timeout("playing");
|
||||
|
|
Loading…
Reference in New Issue