Add infrared receiver entity#169110
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
Adds first-class support for infrared receiver entities to the existing infrared domain, complementing existing emitter/send functionality and enabling signal subscription APIs per the referenced architecture discussion.
Changes:
- Split the prior infrared entity concept into distinct
InfraredEmitterEntityand newInfraredReceiverEntitybase classes, plus aInfraredReceivedSignalmodel. - Add receiver-focused helpers (
async_get_receivers,async_subscribe_receiver) alongside filtering updates to existing helper(s). - Update translations/icons and extend the integration’s test suite to cover receiver enumeration, subscription, and state behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/infrared/__init__.py |
Introduces receiver entity base class and subscription helper; updates component typing and emitter filtering. |
homeassistant/components/infrared/strings.json |
Adds entity_component names and a receiver-specific “not found” exception message. |
homeassistant/components/infrared/icons.json |
Adds device-class icon mapping for receivers (and default mapping). |
tests/components/infrared/conftest.py |
Reworks test fixtures into separate emitter/receiver mock entities. |
tests/components/infrared/test_init.py |
Extends tests to cover receivers, subscription callbacks, and mixed entity setup/restore behavior. |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
homeassistant/components/infrared/init.py:136
- Make the raised error reflect the actual failure case (missing emitter vs. entity exists but is a receiver) by using an emitter-specific translation key/message (or at least wording like “Infrared emitter entity … not found”). With receiver entities now present in the domain, “Infrared entity … not found” can be misleading when a receiver entity_id is passed.
if entity is None or not isinstance(entity, InfraredEmitterEntity):
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="entity_not_found",
translation_placeholders={"entity_id": entity_id},
)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
|
The merge from |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Proposed change
Implements home-assistant/architecture#1372
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: