From 7a174f5a7e6ef9853b1aaa4531a85c0c1d21f84c Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 17 May 2017 14:20:43 +0200 Subject: [PATCH] Fix Alexa thread suspend --- resources/lib/websocket_client.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/lib/websocket_client.py b/resources/lib/websocket_client.py index 3c9a0264..7c995632 100644 --- a/resources/lib/websocket_client.py +++ b/resources/lib/websocket_client.py @@ -209,7 +209,6 @@ class PMS_Websocket(WebSocket): window('plex_online', value='false') -@thread_methods(add_suspends=['RESTRICTED_USER', 'PLEX_TOKEN']) class Alexa_Websocket(WebSocket): """ Websocket connection to talk to Amazon Alexa @@ -248,3 +247,15 @@ class Alexa_Websocket(WebSocket): def IOError_response(self): pass + + def thread_suspended(self): + """ + Overwrite method since we need to check for plex token + """ + if self.__thread_suspended is True: + return True + if not state.PLEX_TOKEN: + return True + if state.RESTRICTED_USER: + return True + return False