mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Add warning during playback if Plex token missing (#51853)
This commit is contained in:
parent
0d40ba463e
commit
e929774481
@ -492,6 +492,10 @@ class PlexMediaPlayer(MediaPlayerEntity):
|
|||||||
"Client is not currently accepting playback controls: %s", self.name
|
"Client is not currently accepting playback controls: %s", self.name
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
if not self.plex_server.has_token:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"Plex integration configured without a token, playback may fail"
|
||||||
|
)
|
||||||
|
|
||||||
src = json.loads(media_id)
|
src = json.loads(media_id)
|
||||||
if isinstance(src, int):
|
if isinstance(src, int):
|
||||||
|
@ -537,6 +537,11 @@ class PlexServer:
|
|||||||
"""Return the plexapi PlexServer instance."""
|
"""Return the plexapi PlexServer instance."""
|
||||||
return self._plex_server
|
return self._plex_server
|
||||||
|
|
||||||
|
@property
|
||||||
|
def has_token(self):
|
||||||
|
"""Return if a token is used to connect to this Plex server."""
|
||||||
|
return self._token is not None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def accounts(self):
|
def accounts(self):
|
||||||
"""Return accounts associated with the Plex server."""
|
"""Return accounts associated with the Plex server."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user