File: device.py

package info (click to toggle)
python-rokuecp 0.19.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 664 kB
  • sloc: python: 2,193; xml: 547; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 618 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
# pylint: disable=W0621
"""Asynchronous Python client for Roku."""
import asyncio

from rokuecp import Roku


async def main() -> None:
    """Show example of connecting to your Roku."""
    async with Roku("192.168.1.61") as roku:
        # Get Roku Device Info
        device = await roku.update()
        print(device.info)

        await roku.remote("poweron")
        await asyncio.sleep(2)
        await roku.remote("home")

        # Open Netflix
        await asyncio.sleep(2)
        await roku.launch("12")


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())