omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Remotely control roku 3 from pythonista

    Pythonista
    1.6 remote-control roku
    1
    2
    2269
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Webmaster4o
      Webmaster4o last edited by

      I've been able to get the roku module working on pythonista! I briefly had a problem when it required lxml, but it seems to work just fine if I replace

      from lxml import etree
      

      With

      from xml import etree
      

      I've been able to successfully connect to my roku with my iPad and act as the remote (up, down, left, right, select) more to come!

      1 Reply Last reply Reply Quote 0
      • Webmaster4o
        Webmaster4o last edited by

        Script to type on the keyboard using up/down/left/right:

        # coding: utf-8
        import roku, time
        
        r = roku.Roku('192.168.1.110')
        
        keylist = [
        ['a','b','c','d','e','f','g'],
        ['h','i','j','k','l','m','n'],
        ['o','p','q','r','s','t','u'],
        ['v','w','x','y','z','-','\''],
        [' '],]
        
        keymap = {}
        
        for y in range(len(keylist)):
        	for x in range(len(keylist[y])):
        		key = keylist[y][x]
        		keymap[key]=(x, y)
        
        
        
        
        def type(string):
        	for l in string.lower():
        		x, y = keymap[l]
        		
        		for _ in range(x):
        			r.right()
        		for _ in range(y):
        			r.down()
        		r.select()
        		for _ in range(x):
        			r.left()
        		for _ in range(y):
        			r.up()
        
        while 1:	
        	type(raw_input())
        

        It was designed for the YouTube app's size keyboard. Resets the cursor to 'a' every time, but the version that didn't failed miserably. Still experimental.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors