[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:
Carrie Watts
2026-09-14 18:57:57 -04:00
committed by GitHub
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_();
}