Skip to content

Add the audio receiver category - #554

Merged
ikalchev merged 1 commit into
devfrom
topic/ikalchev/audio-receiver-category
Nov 11, 2026
Merged

ikalchev merged 1 commit into
devfrom
topic/ikalchev/audio-receiver-category

Conversation

@ikalchev

Copy link
Copy Markdown
Owner

Closes #444

Adds the AUDIO_RECEIVER accessory category (34, per the HAP specification) so audio receivers get the proper tile/icon in the Home app.

What's in it

  • pyhap/const.py: CATEGORY_AUDIO_RECEIVER = 34. As discussed in Any chance to support Category.AUDIO_RECEIVER ? #444, a category is purely a UI hint to iOS clients (it only appears in the Bonjour ci TXT record and the X-HM setup URI), so no further plumbing is required — the driver and setup payload already handle any category value.
  • tests/test_accessory.py: an xhm_uri test case for the new category, covering the QR setup payload encoding.
  • accessories/AudioReceiver.py: a runnable example accessory using the category with the Speaker service (mute + volume).
  • docs/source/intro/examples.rst: lists the new example.

Checks

  • Full pytest suite passes (the one flaky media E2E test also passes in isolation on clean dev).
  • ruff check / ruff format --check pass.
  • ty check shows no new findings vs. the dev baseline.
  • Sphinx build passes with -W (zero warnings).

🤖 This PR was prepared with AI assistance as part of the backlog triage of #444; the category value was verified against the HAP spec and an independent HomeKit implementation.

Add CATEGORY_AUDIO_RECEIVER = 34 per the HAP specification, a runnable
AudioReceiver example accessory exercising the Speaker service, an
xhm_uri test for the new category, and a docs entry for the example.

Closes #444
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.23%. Comparing base (c84f3fa) to head (0a06e69).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #554   +/-   ##
=======================================
  Coverage   92.22%   92.23%           
=======================================
  Files          40       40           
  Lines        7644     7645    +1     
  Branches      963      963           
=======================================
+ Hits         7050     7051    +1     
  Misses        415      415           
  Partials      179      179           
Files with missing lines Coverage Δ
pyhap/const.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ikalchev
ikalchev merged commit 064277f into dev Nov 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Any chance to support Category.AUDIO_RECEIVER ?

1 participant