Handle missing transport_state on media update in sonos (#50051)

This commit is contained in:
J. Nick Koston 2021-05-03 20:54:31 -10:00 committed by GitHub
parent 2eae87fb1b
commit 016a4433d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -488,7 +488,9 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
"""Update information about currently playing media."""
variables = event and event.variables
if variables:
if variables and "transport_state" in variables:
# If the transport has an error then transport_state will
# not be set
new_status = variables["transport_state"]
else:
transport_info = self.soco.get_current_transport_info()