mirror of https://github.com/esphome/esphome.git
check if task has been already created while calling start()
This commit is contained in:
parent
3b5ef399e0
commit
116ea49549
|
@ -23,7 +23,10 @@ void I2SAudioSpeaker::setup() {
|
|||
}
|
||||
|
||||
void I2SAudioSpeaker::start() {
|
||||
this->task_created_ = false;
|
||||
if (this->task_created_) {
|
||||
ESP_LOGD(TAG, "Called start while task has been already created.");
|
||||
return;
|
||||
}
|
||||
this->state_ = speaker::STATE_STARTING;
|
||||
}
|
||||
void I2SAudioSpeaker::start_() {
|
||||
|
|
Loading…
Reference in New Issue