Bump plexwebsocket to 0.0.13 (#48330)
parent
ec1334099e
commit
e42ca35c94
|
@ -7,7 +7,6 @@ import plexapi.exceptions
|
||||||
from plexapi.gdm import GDM
|
from plexapi.gdm import GDM
|
||||||
from plexwebsocket import (
|
from plexwebsocket import (
|
||||||
SIGNAL_CONNECTION_STATE,
|
SIGNAL_CONNECTION_STATE,
|
||||||
SIGNAL_DATA,
|
|
||||||
STATE_CONNECTED,
|
STATE_CONNECTED,
|
||||||
STATE_DISCONNECTED,
|
STATE_DISCONNECTED,
|
||||||
STATE_STOPPED,
|
STATE_STOPPED,
|
||||||
|
@ -158,9 +157,9 @@ async def async_setup_entry(hass, entry):
|
||||||
hass.data[PLEX_DOMAIN][DISPATCHERS][server_id].append(unsub)
|
hass.data[PLEX_DOMAIN][DISPATCHERS][server_id].append(unsub)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def plex_websocket_callback(signal, data, error):
|
def plex_websocket_callback(msgtype, data, error):
|
||||||
"""Handle callbacks from plexwebsocket library."""
|
"""Handle callbacks from plexwebsocket library."""
|
||||||
if signal == SIGNAL_CONNECTION_STATE:
|
if msgtype == SIGNAL_CONNECTION_STATE:
|
||||||
|
|
||||||
if data == STATE_CONNECTED:
|
if data == STATE_CONNECTED:
|
||||||
_LOGGER.debug("Websocket to %s successful", entry.data[CONF_SERVER])
|
_LOGGER.debug("Websocket to %s successful", entry.data[CONF_SERVER])
|
||||||
|
@ -178,7 +177,7 @@ async def async_setup_entry(hass, entry):
|
||||||
)
|
)
|
||||||
hass.async_create_task(hass.config_entries.async_reload(entry.entry_id))
|
hass.async_create_task(hass.config_entries.async_reload(entry.entry_id))
|
||||||
|
|
||||||
elif signal == SIGNAL_DATA:
|
elif msgtype == "playing":
|
||||||
hass.async_create_task(plex_server.async_update_session(data))
|
hass.async_create_task(plex_server.async_update_session(data))
|
||||||
|
|
||||||
session = async_get_clientsession(hass)
|
session = async_get_clientsession(hass)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"plexapi==4.5.1",
|
"plexapi==4.5.1",
|
||||||
"plexauth==0.0.6",
|
"plexauth==0.0.6",
|
||||||
"plexwebsocket==0.0.12"
|
"plexwebsocket==0.0.13"
|
||||||
],
|
],
|
||||||
"dependencies": ["http"],
|
"dependencies": ["http"],
|
||||||
"codeowners": ["@jjlawren"]
|
"codeowners": ["@jjlawren"]
|
||||||
|
|
|
@ -257,11 +257,7 @@ class PlexServer:
|
||||||
|
|
||||||
async def async_update_session(self, payload):
|
async def async_update_session(self, payload):
|
||||||
"""Process a session payload received from a websocket callback."""
|
"""Process a session payload received from a websocket callback."""
|
||||||
try:
|
session_payload = payload["PlaySessionStateNotification"][0]
|
||||||
session_payload = payload["PlaySessionStateNotification"][0]
|
|
||||||
except KeyError:
|
|
||||||
await self.async_update_platforms()
|
|
||||||
return
|
|
||||||
|
|
||||||
state = session_payload["state"]
|
state = session_payload["state"]
|
||||||
if state == "buffering":
|
if state == "buffering":
|
||||||
|
|
|
@ -1140,7 +1140,7 @@ plexapi==4.5.1
|
||||||
plexauth==0.0.6
|
plexauth==0.0.6
|
||||||
|
|
||||||
# homeassistant.components.plex
|
# homeassistant.components.plex
|
||||||
plexwebsocket==0.0.12
|
plexwebsocket==0.0.13
|
||||||
|
|
||||||
# homeassistant.components.plugwise
|
# homeassistant.components.plugwise
|
||||||
plugwise==0.8.5
|
plugwise==0.8.5
|
||||||
|
|
|
@ -586,7 +586,7 @@ plexapi==4.5.1
|
||||||
plexauth==0.0.6
|
plexauth==0.0.6
|
||||||
|
|
||||||
# homeassistant.components.plex
|
# homeassistant.components.plex
|
||||||
plexwebsocket==0.0.12
|
plexwebsocket==0.0.13
|
||||||
|
|
||||||
# homeassistant.components.plugwise
|
# homeassistant.components.plugwise
|
||||||
plugwise==0.8.5
|
plugwise==0.8.5
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Helper methods for Plex tests."""
|
"""Helper methods for Plex tests."""
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from plexwebsocket import SIGNAL_CONNECTION_STATE, SIGNAL_DATA, STATE_CONNECTED
|
from plexwebsocket import SIGNAL_CONNECTION_STATE, STATE_CONNECTED
|
||||||
|
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ def websocket_connected(mock_websocket):
|
||||||
def trigger_plex_update(mock_websocket, payload=UPDATE_PAYLOAD):
|
def trigger_plex_update(mock_websocket, payload=UPDATE_PAYLOAD):
|
||||||
"""Call the websocket callback method with a Plex update."""
|
"""Call the websocket callback method with a Plex update."""
|
||||||
callback = mock_websocket.call_args[0][1]
|
callback = mock_websocket.call_args[0][1]
|
||||||
callback(SIGNAL_DATA, payload, None)
|
callback("playing", payload, None)
|
||||||
|
|
||||||
|
|
||||||
async def wait_for_debouncer(hass):
|
async def wait_for_debouncer(hass):
|
||||||
|
|
Loading…
Reference in New Issue