IR sources (Flipper .ir, HA code sets) → a common Signal for ESPHome and HA's IR proxy.
Project description
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
.irtext 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).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file homeops_ir_adapter-0.1.1.tar.gz.
File metadata
- Download URL: homeops_ir_adapter-0.1.1.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2777fd954cd1144cdf9b3fa6735a002626594a7c6c984819f9e8d767904a37e
|
|
| MD5 |
affc73c82b12e970abe59776880302bc
|
|
| BLAKE2b-256 |
0c04d922ac481873d23727fa044ec24db67b2ff2221f705c81ea2368365b0cd1
|
Provenance
The following attestation bundles were made for homeops_ir_adapter-0.1.1.tar.gz:
Publisher:
publish.yaml on HomeOps/ir-adapter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
homeops_ir_adapter-0.1.1.tar.gz -
Subject digest:
b2777fd954cd1144cdf9b3fa6735a002626594a7c6c984819f9e8d767904a37e - Sigstore transparency entry: 1846556838
- Sigstore integration time:
-
Permalink:
HomeOps/ir-adapter@3407cbaffce1ea1e0d25a7184c6f14b3d90d224e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HomeOps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@3407cbaffce1ea1e0d25a7184c6f14b3d90d224e -
Trigger Event:
push
-
Statement type:
File details
Details for the file homeops_ir_adapter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: homeops_ir_adapter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
170512183825d678997606f99268dc2b83d26a8d3d02258f2ebbddc47b1a7ab0
|
|
| MD5 |
26c069f8bdc112c92f97323b8fe4c621
|
|
| BLAKE2b-256 |
8a86e79bb5ffbd9bd68b7feacd38e63e065d2ee1cbb0b7d33f0855a2f77d397e
|
Provenance
The following attestation bundles were made for homeops_ir_adapter-0.1.1-py3-none-any.whl:
Publisher:
publish.yaml on HomeOps/ir-adapter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
homeops_ir_adapter-0.1.1-py3-none-any.whl -
Subject digest:
170512183825d678997606f99268dc2b83d26a8d3d02258f2ebbddc47b1a7ab0 - Sigstore transparency entry: 1846556912
- Sigstore integration time:
-
Permalink:
HomeOps/ir-adapter@3407cbaffce1ea1e0d25a7184c6f14b3d90d224e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HomeOps
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@3407cbaffce1ea1e0d25a7184c6f14b3d90d224e -
Trigger Event:
push
-
Statement type: