mirror of
https://github.com/esphome/esphome.git
synced 2024-12-21 16:27:44 +01:00
Setup the mute pin if configured (#3568)
This commit is contained in:
parent
8c9948bb56
commit
aa0c2dedd9
@ -109,6 +109,10 @@ void I2SAudioMediaPlayer::setup() {
|
|||||||
this->audio_ = make_unique<Audio>(false);
|
this->audio_ = make_unique<Audio>(false);
|
||||||
this->audio_->setPinout(this->bclk_pin_, this->lrclk_pin_, this->dout_pin_);
|
this->audio_->setPinout(this->bclk_pin_, this->lrclk_pin_, this->dout_pin_);
|
||||||
this->audio_->forceMono(this->external_dac_channels_ == 1);
|
this->audio_->forceMono(this->external_dac_channels_ == 1);
|
||||||
|
if (this->mute_pin_ != nullptr) {
|
||||||
|
this->mute_pin_->setup();
|
||||||
|
this->mute_pin_->digital_write(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this->state = media_player::MEDIA_PLAYER_STATE_IDLE;
|
this->state = media_player::MEDIA_PLAYER_STATE_IDLE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user