Skip to main content

emulated_roku

Library to emulate the Roku API for Home Assistant and other automation tools. Discovery is tested with Logitech Harmony and Android remotes.

Installation

pip install emulated_roku

Requires Python 3.12+.

Usage

Subclass EmulatedRokuCommandHandler to handle key press / down / up events and app launches, then start the server:

import asyncio
import emulated_roku

class MyHandler(emulated_roku.EmulatedRokuCommandHandler):
    def on_keypress(self, roku_usn, key):
        print(f"Key pressed: {key}")

    def launch(self, roku_usn, app_id):
        print(f"Launch app: {app_id}")

async def main():
    server = emulated_roku.EmulatedRokuServer(
        MyHandler(),
        "my-roku",
        emulated_roku.get_local_ip(),
        8060,
    )
    await server.start()
    await asyncio.Event().wait()

asyncio.run(main())

See example.py for a minimal runnable example.

Custom apps

The application list can be customized with a comma- or newline-separated string:

server = emulated_roku.EmulatedRokuServer(
    handler, "my-roku", "192.168.1.10", 8060,
    custom_apps="1:Netflix,2:YouTube,3:Plex",
)

This produces:

<apps>
    <app id="1" version="1.0.0">Netflix</app>
    <app id="2" version="1.0.0">YouTube</app>
    <app id="3" version="1.0.0">Plex</app>
</apps>

Development

python -m venv .venv
source .venv/bin/activate
pip install -e .[test]
pytest tests/ -v

Metadata

Release files for emulated-roku 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emulated-roku 0.5.1
File Size Uploaded
emulated_roku-0.5.1.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for emulated-roku 0.5.1
File Interpreter ABI Platform
emulated_roku-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / emulated_roku-0.5.1.tar.gz

Download URL emulated_roku-0.5.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7c7834d601fb4725168477c4dc7e87b987ebc2802fd4e3c93d4de6d286dd8a13
BLAKE2b-256 checksum
How to use checksums
fe3291e92fb35ecb375c840052be02fac7e20fd2b4dcc331d747c585a7e8d86b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 17, 2026.

Transparency log

Release files / emulated_roku-0.5.1-py3-none-any.whl

Download URL emulated_roku-0.5.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5c1ef202eb3e5461966cd1cb8f55800094d0ad86ae72696a273b7f81334a7fa
BLAKE2b-256 checksum
How to use checksums
400e5846955da4c53956d03c0d7d74e15522ed3ba0af5c35ce9dd6f302c36d29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page