Add Plex debug logging (#28665)
parent
25f0b70966
commit
ef687a36ff
|
@ -102,7 +102,7 @@ class PlexFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
return await self.async_step_select_server()
|
||||
|
||||
except Exception as error: # pylint: disable=broad-except
|
||||
_LOGGER.error("Unknown error connecting to Plex server: %s", error)
|
||||
_LOGGER.exception("Unknown error connecting to Plex server: %s", error)
|
||||
return self.async_abort(reason="unknown")
|
||||
|
||||
if errors:
|
||||
|
|
|
@ -75,6 +75,7 @@ def _async_add_entities(
|
|||
hass, registry, config_entry, async_add_entities, server_id, new_entities
|
||||
):
|
||||
"""Set up Plex media_player entities."""
|
||||
_LOGGER.debug("New entities: %s", new_entities)
|
||||
entities = []
|
||||
plexserver = hass.data[PLEX_DOMAIN][SERVERS][server_id]
|
||||
for entity_params in new_entities:
|
||||
|
@ -142,6 +143,7 @@ class PlexMediaPlayer(MediaPlayerDevice):
|
|||
"""Run when about to be added to hass."""
|
||||
server_id = self.plex_server.machine_identifier
|
||||
|
||||
_LOGGER.debug("Added %s [%s]", self.entity_id, self.unique_id)
|
||||
unsub = async_dispatcher_connect(
|
||||
self.hass,
|
||||
PLEX_UPDATE_MEDIA_PLAYER_SIGNAL.format(self.unique_id),
|
||||
|
@ -152,6 +154,7 @@ class PlexMediaPlayer(MediaPlayerDevice):
|
|||
@callback
|
||||
def async_refresh_media_player(self, device, session):
|
||||
"""Set instance objects and trigger an entity state update."""
|
||||
_LOGGER.debug("Refreshing %s [%s / %s]", self.entity_id, device, session)
|
||||
self.device = device
|
||||
self.session = session
|
||||
self.async_schedule_update_ha_state(True)
|
||||
|
|
|
@ -93,6 +93,7 @@ class PlexSensor(Entity):
|
|||
|
||||
def update(self):
|
||||
"""Update method for Plex sensor."""
|
||||
_LOGGER.debug("Refreshing sensor [%s]", self.unique_id)
|
||||
now_playing = []
|
||||
for sess in self.sessions:
|
||||
user = sess.usernames[0]
|
||||
|
|
|
@ -95,6 +95,7 @@ class PlexServer:
|
|||
def refresh_entity(self, machine_identifier, device, session):
|
||||
"""Forward refresh dispatch to media_player."""
|
||||
unique_id = f"{self.machine_identifier}:{machine_identifier}"
|
||||
_LOGGER.debug("Refreshing %s", unique_id)
|
||||
dispatcher_send(
|
||||
self._hass,
|
||||
PLEX_UPDATE_MEDIA_PLAYER_SIGNAL.format(unique_id),
|
||||
|
|
Loading…
Reference in New Issue