python-samsung-smarttv-2016 icon indicating copy to clipboard operation
python-samsung-smarttv-2016 copied to clipboard

Pressing one key is ignored

Open SteveAyre opened this issue 7 years ago • 1 comments

It seems that if only one keycode is given it gets ignored. Debugging this time.sleep(delay) doesn't get called so the websocket disconnects as soon as it has sent the command, which seems to mean my TV ignores the request. Making the time.sleep run on every key solves this for me.

SteveAyre avatar Jul 28 '17 22:07 SteveAyre

While True: message = yield from websocket.recv() parsed = json.loads(message) if (parsed['event'] == 'ms.channel.connect'):
k = 0 for key in _keys: k = k + 1 cmd = '{"method":"ms.remote.control","params":{"Cmd":"Click","DataOfCmd":"%s","Option":"false","TypeOfRemote":"SendRemoteKey"}}' % key yield from websocket.send(cmd) if k != len(_keys): time.sleep(delay)
break time.sleep(delay) finally: yield from websocket.close()

WiseSage17 avatar Jan 11 '18 10:01 WiseSage17