mirror of
https://github.com/esphome/esphome.git
synced 2026-09-18 02:28:42 +00:00
[speaker_source] keep mute when volume changes (#18412)
Signed-off-by: carriewattsmake <carriewattsmake@users.noreply.github.com> Co-authored-by: carriewattsmake <carriewattsmake@users.noreply.github.com> Co-authored-by: Kevin Ahrendt <kevin.ahrendt@openhomefoundation.org>
This commit is contained in:
co-authored by
carriewattsmake
Kevin Ahrendt
parent
7a25ca0741
commit
0af1f22e77
@@ -832,15 +832,6 @@ void SpeakerSourceMediaPlayer::set_volume_(float volume, bool publish) {
|
||||
}
|
||||
}
|
||||
|
||||
// Turn on the mute state if the volume is effectively zero, off otherwise.
|
||||
// Pass publish=false to avoid saving twice.
|
||||
if (volume < speaker::SILENT_VOLUME_THRESHOLD) {
|
||||
this->set_mute_state_(true, false);
|
||||
} else {
|
||||
this->set_mute_state_(false, false);
|
||||
}
|
||||
|
||||
// Save after mute mutation so the restored state has the correct is_muted_ value
|
||||
if (publish) {
|
||||
this->save_volume_restore_state_();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user