Skip to content

Add infrared receiver entity#169110

Merged
abmantis merged 25 commits into
devfrom
ir_receiver
May 13, 2026
Merged

Add infrared receiver entity#169110
abmantis merged 25 commits into
devfrom
ir_receiver

Conversation

@abmantis
Copy link
Copy Markdown
Member

Proposed change

Implements home-assistant/architecture#1372

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (infrared) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of infrared can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign infrared Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 InfraredEmitterEntity and new InfraredReceiverEntity base classes, plus a InfraredReceivedSignal model.
  • 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.

Comment thread homeassistant/components/infrared/__init__.py Outdated
Comment thread homeassistant/components/infrared/__init__.py
Comment thread homeassistant/components/infrared/__init__.py
@frenck frenck added this to the 2026.6.0b0 milestone Apr 30, 2026
Copilot AI review requested due to automatic review settings April 30, 2026 18:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread homeassistant/components/infrared/__init__.py
Comment thread homeassistant/components/kitchen_sink/infrared.py
Comment thread homeassistant/components/infrared/__init__.py Outdated
Copilot AI review requested due to automatic review settings April 30, 2026 18:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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},
        )

Comment thread homeassistant/components/infrared/__init__.py Outdated
Copilot AI review requested due to automatic review settings May 4, 2026 21:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Comment thread homeassistant/components/kitchen_sink/infrared.py
Comment thread homeassistant/components/kitchen_sink/config_flow.py
Comment thread homeassistant/components/broadlink/infrared.py
Comment thread homeassistant/components/esphome/infrared.py
Comment thread homeassistant/components/smlight/infrared.py
Copilot AI review requested due to automatic review settings May 11, 2026 16:42
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@abmantis abmantis marked this pull request as ready for review May 11, 2026 16:45
@home-assistant home-assistant Bot requested a review from MartinHjelmare May 11, 2026 16:46
@abmantis
Copy link
Copy Markdown
Member Author

The merge from dev required a few more changes since tests now have shared fixtures.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.

Comment thread tests/components/infrared/conftest.py Outdated
Comment thread homeassistant/components/kitchen_sink/config_flow.py
Comment thread homeassistant/components/infrared/strings.json
Comment thread homeassistant/components/infrared/__init__.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 11, 2026 17:31
@abmantis abmantis marked this pull request as draft May 11, 2026 17:31
@abmantis abmantis marked this pull request as ready for review May 11, 2026 17:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Comment thread homeassistant/components/kitchen_sink/config_flow.py
Comment thread homeassistant/components/kitchen_sink/event.py
Comment thread tests/components/infrared/conftest.py Outdated
Comment thread homeassistant/components/infrared/__init__.py
Copilot AI review requested due to automatic review settings May 12, 2026 14:29
Copilot stopped reviewing on behalf of abmantis due to an error May 12, 2026 14:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 4 comments.

Comment thread homeassistant/components/infrared/__init__.py
Comment thread homeassistant/components/infrared/__init__.py
Comment thread homeassistant/components/kitchen_sink/config_flow.py
Comment thread tests/components/lg_infrared/test_config_flow.py
Copilot AI review requested due to automatic review settings May 12, 2026 14:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/kitchen_sink/config_flow.py
@abmantis abmantis merged commit b9105db into dev May 13, 2026
52 checks passed
@abmantis abmantis deleted the ir_receiver branch May 13, 2026 17:21
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants