Skip to main content

ir-adapter

Turn IR sources into a common Signal that drives both ESPHome firmware and a Home Assistant IR-proxy custom component — one representation, two transmit paths. The signal/protocol sibling to ir-canonical (which owns the name).

pip install homeops-ir-adapter

Use it

from ir_adapter import flipper, ha, Signal

signals = flipper.from_file("TVs/Sony/Sony_Bravia.ir")   # a Flipper-IRDB .ir path
signals = ha.from_codeset("vizio/tv")                    # an infrared-protocols code set

s = signals[0]
s.name           # "Power"
s.canonical      # "power_toggle"  (resolved via homeops-ir-canonical; None if unmapped)
s.carrier_hz     # 38000
s.timings        # (9000, -4500, 560, -560, ...)  signed: + mark, - space
s.protocol       # "NEC" (None for raw captures)
s.address, s.command
s.repeat         # transmit-layer repeats (parsed frames need ~3)

Every Signal is self-describing: it carries its canonical control id, so a consumer (esp-codegen, concerto) depends only on homeops-ir-adapter and gets the control name for free — no separate name-resolution step.

A Signal carries both forms so either consumer uses what it needs:

Consumer Uses
ESPHome YAML (esphome-ir-codegen) carrier_hz + timings → remote_transmitter.transmit_raw (or protocol/address/command → transmit_nec/…)
HA IR-proxy custom component (concerto) protocol/address/command → the proxy, with raw timings as fallback

Adapters

Adapter Input Call
flipper a Flipper-IRDB .ir file path flipper.from_file(path) / flipper.from_text(text)
ha an infrared-protocols code set (<brand>/<type>) ha.from_codeset("vizio/tv") / ha.codesets()

Parsed protocols (NEC/NECext, Sony SIRC/15/20, Samsung32, RC5/RC5X, Sharp) are encoded to timings by infrared-protocols — the same encoder HA's IR proxy uses, so codes are protocol-correct by construction. A Flipper type: raw capture passes through as-is.

Requires Python ≥ 3.14 (the infrared-protocols dependency). Parsing of .ir text works without it; encoding parsed protocols needs it.

Develop

python -m build --wheel --no-isolation
pip install dist/*.whl && pytest -q

Releases: release-please cuts a release PR; merging it tags + publishes to PyPI via trusted publishing (publish.yaml, environment pypi).

Metadata

Release files for homeops-ir-adapter 0.1.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 homeops-ir-adapter 0.1.1
File Size Uploaded
homeops_ir_adapter-0.1.1.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for homeops-ir-adapter 0.1.1
File Interpreter ABI Platform
homeops_ir_adapter-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / homeops_ir_adapter-0.1.1.tar.gz

Download URL homeops_ir_adapter-0.1.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b2777fd954cd1144cdf9b3fa6735a002626594a7c6c984819f9e8d767904a37e
BLAKE2b-256 checksum
How to use checksums
0c04d922ac481873d23727fa044ec24db67b2ff2221f705c81ea2368365b0cd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 17, 2026.

Transparency log

Release files / homeops_ir_adapter-0.1.1-py3-none-any.whl

Download URL homeops_ir_adapter-0.1.1-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
170512183825d678997606f99268dc2b83d26a8d3d02258f2ebbddc47b1a7ab0
BLAKE2b-256 checksum
How to use checksums
8a86e79bb5ffbd9bd68b7feacd38e63e065d2ee1cbb0b7d33f0855a2f77d397e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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