mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
fix for plex not detecting plex players after power up (#1824)
This commit is contained in:
parent
abd376cbba
commit
0abedd8b46
@ -18,6 +18,7 @@ from homeassistant.const import (
|
|||||||
DEVICE_DEFAULT_NAME, STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING,
|
DEVICE_DEFAULT_NAME, STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING,
|
||||||
STATE_UNKNOWN)
|
STATE_UNKNOWN)
|
||||||
from homeassistant.loader import get_component
|
from homeassistant.loader import get_component
|
||||||
|
from homeassistant.helpers.event import (track_utc_time_change)
|
||||||
|
|
||||||
REQUIREMENTS = ['plexapi==1.1.0']
|
REQUIREMENTS = ['plexapi==1.1.0']
|
||||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||||
@ -113,6 +114,7 @@ def setup_plexserver(host, token, hass, add_devices_callback):
|
|||||||
|
|
||||||
plex_clients = {}
|
plex_clients = {}
|
||||||
plex_sessions = {}
|
plex_sessions = {}
|
||||||
|
track_utc_time_change(hass, lambda now: update_devices(), second=30)
|
||||||
|
|
||||||
@util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
|
@util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
|
||||||
def update_devices():
|
def update_devices():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user