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.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)

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.0.tar.gz (8.0 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.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file homeops_ir_adapter-0.1.0.tar.gz.

File metadata

  • Download URL: homeops_ir_adapter-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 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.0.tar.gz
Algorithm Hash digest
SHA256 72b1cf1f0908b1745924f20518a8be2a12ce6298db27ceab237d84063aa7edd9
MD5 8b784ac68bf0fa7b03ba33ef5e9d0b5f
BLAKE2b-256 ca50ba389046f78664b1f118eb092b2ba3c112eb48c98ef2c8dceb4e663b5573

See more details on using hashes here.

Provenance

The following attestation bundles were made for homeops_ir_adapter-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for homeops_ir_adapter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7a8d040173ae30ed6778a7a3977ab9c02158d01f523741b54ad04fa064d5d821
MD5 ebc4797984f91090b30bd2200f6e5689
BLAKE2b-256 223235def0ac7e9b315315a79a9421e44feaf4bf610b7bb25300050c7b408c23

See more details on using hashes here.

Provenance

The following attestation bundles were made for homeops_ir_adapter-0.1.0-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