mirror of
https://github.com/home-assistant/core.git
synced 2025-07-05 20:37:16 +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."""
|
"""Update information about currently playing media."""
|
||||||
variables = event and event.variables
|
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"]
|
new_status = variables["transport_state"]
|
||||||
else:
|
else:
|
||||||
transport_info = self.soco.get_current_transport_info()
|
transport_info = self.soco.get_current_transport_info()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user