File: example.py

package info (click to toggle)
emulated-roku 0.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144 kB
  • sloc: python: 889; makefile: 3
file content (22 lines) | stat: -rwxr-xr-x 573 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
#!/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():
        roku_api = emulated_roku.EmulatedRokuServer(
            emulated_roku.EmulatedRokuCommandHandler(),
            "test_roku", emulated_roku.get_local_ip(), 8060,
            custom_apps = None
        )

        await roku_api.start()
        await asyncio.Event().wait()

    asyncio.run(start_emulated_roku())