mirror of
https://github.com/home-assistant/core.git
synced 2025-07-04 03:47:09 +00:00
Handle missing transport_state on media update in sonos (#50051)
This commit is contained in:
parent
2eae87fb1b
commit
016a4433d2
@ -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…
x
Reference in New Issue
Block a user