Skip to main content

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 + timingsremote_transmitter.transmit_raw (or protocol/address/commandtransmit_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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

homeops_ir_adapter-0.1.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

homeops_ir_adapter-0.1.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

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

Hashes for homeops_ir_adapter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b2777fd954cd1144cdf9b3fa6735a002626594a7c6c984819f9e8d767904a37e
MD5 affc73c82b12e970abe59776880302bc
BLAKE2b-256 0c04d922ac481873d23727fa044ec24db67b2ff2221f705c81ea2368365b0cd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for homeops_ir_adapter-0.1.1.tar.gz:

Publisher: publish.yaml on HomeOps/ir-adapter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file homeops_ir_adapter-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for homeops_ir_adapter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 170512183825d678997606f99268dc2b83d26a8d3d02258f2ebbddc47b1a7ab0
MD5 26c069f8bdc112c92f97323b8fe4c621
BLAKE2b-256 8a86e79bb5ffbd9bd68b7feacd38e63e065d2ee1cbb0b7d33f0855a2f77d397e

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page