Fix state updating for crossfade switch on Sonos (#79776)

This commit is contained in:
jjlawren 2022-10-06 23:29:34 -05:00 committed by Paulus Schoutsen
parent 81783fd52b
commit 1143ede4db

View File

@ -489,7 +489,10 @@ class SonosSpeaker:
return
if crossfade := event.variables.get("current_crossfade_mode"):
self.cross_fade = bool(int(crossfade))
crossfade = bool(int(crossfade))
if self.cross_fade != crossfade:
self.cross_fade = crossfade
self.async_write_entity_states()
# Missing transport_state indicates a transient error
if (new_status := event.variables.get("transport_state")) is None: