Skip to content

Commit

Permalink
Unique IDs for Plex Clients (home-assistant#12799)
Browse files Browse the repository at this point in the history
* Unique IDs for Clients

* HoundCI cleanup

* debug output removal

* Updates from feedback

* More Updates from feedback

* More Updates from feedback

* Lint Fixes
  • Loading branch information
ryanm101 authored and balloob committed Mar 1, 2018
1 parent 53078f3 commit a60712d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion homeassistant/components/media_player/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
import json
import logging

from datetime import timedelta

import requests
Expand Down Expand Up @@ -47,9 +48,14 @@
cv.boolean,
})

PLEX_DATA = "plex"


def setup_platform(hass, config, add_devices_callback, discovery_info=None):
"""Set up the Plex platform."""
if PLEX_DATA not in hass.data:
hass.data[PLEX_DATA] = {}

# get config from plex.conf
file_config = load_json(hass.config.path(PLEX_CONFIG_FILE))

Expand Down Expand Up @@ -130,7 +136,7 @@ def setup_plexserver(

_LOGGER.info('Connected to: %s://%s', http_prefix, host)

plex_clients = {}
plex_clients = hass.data[PLEX_DATA]
plex_sessions = {}
track_utc_time_change(hass, lambda now: update_devices(), second=30)

Expand Down

0 comments on commit a60712d

Please sign in to comment.