Skip to content

Development

Igor Kuz edited this page Jul 31, 2026 · 1 revision

Development

Layout

custom_components/htd_lync_pro/
  protocol.py    # frame building/parsing — pure Python, no HA imports
  client.py      # asyncio TCP/serial client, reconnect, push updates
  __init__.py    # setup, options, services
  config_flow.py # config + reconfigure + options flows
  media_player.py, select.py, number.py, switch.py, button.py,
  binary_sensor.py, diagnostics.py
tools/lync_emulator.py   # Lync 12 emulator
tests/test_protocol.py   # protocol tests

Emulator

Develop without hardware:

python3 tools/lync_emulator.py 10006

Point the integration at 127.0.0.1:10006. It simulates 12 named zones, sources, the MP3 player, and the doorbell: send common command 0xA2 (frame 02 00 00 04 A2 A8) to trigger a ring, including the real unit's zones-to-Intercom chime behavior and the stop message 3 s later.

Tests

python3 tests/test_protocol.py

23 tests validate command frames byte-for-byte against HTD's published hex codes and parse fixtures captured from real hardware. CI runs them plus HACS and hassfest validation on every push.

Contributing

PRs welcome — especially captures from other firmware versions (Lync 6, pre-v3) where encodings may differ. Include a debug log (RX/TX lines) with any protocol-related report.

Clone this wiki locally