diff --git a/README.md b/README.md index 9958047..7e9b5ce 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,9 @@ remote.set_pairing_key(key) ``` After this you can send single or multiple commands using `send_command` and `send_multiple`. -2011 Models initiate a session key. This currently still needs to be passed every time you call `send_command` ``` -remote.send_command(Remote.VOLUME_UP, remote.session) +remote.send_command(Remote.audio_controls["VOLUME_UP"]) commands = [Remote.HOME, Remote.EXIT, Remote.MENU] remote.send_multiple(commands) @@ -43,4 +42,4 @@ remote.send_multiple(commands) An optional `delay` parameter can be provided to `send_multiple`; this will the amount of seconds the control will wait between commands. N.B. Sending commands too fast can cause some of them to be ignored. -Shortcuts-structure is subject to change. They still can be looked up in `lg.py`. Be careful on your journey! \ No newline at end of file +Shortcuts-structure is subject to change. They still can be looked up in `lg.py`. Be careful on your journey! diff --git a/lg.py b/lg.py index 50edc3e..c72e095 100644 --- a/lg.py +++ b/lg.py @@ -23,13 +23,13 @@ class Remote(): self.pair_key = pair_key self.ip_address = ip_address - self.session = None + self.__session = None if not self.ip_address: raise Remote.NoTVFound if self.pair_key: - self.session = self.get_session() + self.__session = self.get_session() else: self.request_pair() @@ -83,7 +83,7 @@ class Remote(): """ self.pair_key = pair_key - self.session = self.get_session() + self.__session = self.get_session() def make_request(self, endpoint, content, extra_headers={}): """ @@ -126,7 +126,7 @@ class Remote(): response = self.make_request('/hdcp/api/auth', content) return response.find('session').text - def send_command(self, code, session): + def send_command(self, code): """ Send a remote control key command. Ignores response for now. """ @@ -140,7 +140,7 @@ class Remote(): HandleKeyInput {0} - """.format(code, session) + """.format(code, self.__session) self.make_request('/hdcp/api/dtv_wifirc', content) def send_multiple(self, codes, delay=0.2):