Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, *args, **kwargs):
self.ws_class = kwargs.pop('ws_class', WebOSWebSocketClient)
super(InputControl, self).__init__(*args, **kwargs)
"serial": "2f930e2d2cfe083771f68e4fe7bb07",
"vendorId": "com.lge"
}
},
"pairingType": "PROMPT"
}
class WebOSWebSocketClient(WebSocketClient):
@property
def handshake_headers(self):
headers = super(WebOSWebSocketClient, self).handshake_headers
return [(k, v) for k, v in headers if k.lower() != 'origin']
class WebOSClient(WebOSWebSocketClient):
PROMPTED = 1
REGISTERED = 2
def __init__(self, host):
ws_url = "ws://{}:3000/".format(host)
super(WebOSClient, self).__init__(ws_url)
self.waiters = {}
self.waiter_lock = RLock()
self.subscribers = {}
self.subscriber_lock = RLock()
self.send_lock = RLock()
@staticmethod
def discover():
res = discover("urn:schemas-upnp-org:device:MediaRenderer:1",
keyword="LG", hosts=True, retries=3)
def handshake_headers(self):
headers = super(WebOSWebSocketClient, self).handshake_headers
return [(k, v) for k, v in headers if k.lower() != 'origin']