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 GitHub
parent 07d4ac42d4
commit 5694a4bfc8

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: