File: example.py

package info (click to toggle)
emulated-roku 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 120 kB
  • sloc: python: 442; makefile: 2
file content (26 lines) | stat: -rwxr-xr-x 624 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python3

"""Example script for using the Emulated Roku api."""

if __name__ == "__main__":
    import asyncio
    import logging
    import emulated_roku

    logging.basicConfig(level=logging.DEBUG)

    async def start_emulated_roku(loop):
        roku_api = emulated_roku.EmulatedRokuServer(
            loop, emulated_roku.EmulatedRokuCommandHandler(),
            "test_roku", emulated_roku.get_local_ip(), 8060,
            custom_apps = None
        )

        await roku_api.start()


    loop = asyncio.get_event_loop()

    loop.run_until_complete(start_emulated_roku(loop))

    loop.run_forever()