Handle missing transport_state on media update in sonos (#50051)
This commit is contained in:
parent
2eae87fb1b
commit
016a4433d2
1 changed files with 3 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue