Skip to content

Add Broadlink infrared emitter support#168889

Merged
abmantis merged 5 commits into
home-assistant:devfrom
YuvalWS:broadlink-infrared-followup
Apr 29, 2026
Merged

Add Broadlink infrared emitter support#168889
abmantis merged 5 commits into
home-assistant:devfrom
YuvalWS:broadlink-infrared-followup

Conversation

@YuvalWS
Copy link
Copy Markdown
Contributor

@YuvalWS YuvalWS commented Apr 23, 2026

Breaking change

Proposed change

Adds infrared transmitter support for Broadlink RM devices (RM4MINI, RM4PRO, RMMINI, RMMINIB, RMPRO) to Home Assistant's native infrared platform.

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

Reintroduces Broadlink infrared emitter support on the native infrared
platform. Follow-up to #168385 (reverted in #168717) that addresses all
review feedback before re-landing.

Changes vs. the reverted PR:

  • Drop BroadlinkIRCommand. The speculative subclass had no UI/YAML
    path and couldn't be constructed by standard consumers

  • Rewrite tests against the public dispatcher. Tests now call
    homeassistant.components.infrared.async_send_command and assert on
    mock_setup.api.send_data, instead of reaching into integration
    internals

  • Remove "dependencies": ["infrared"] from the manifest. Only
    IR-capable RM models get Platform.INFRARED forwarded via
    DOMAINS_AND_TYPES, so every non-IR Broadlink device no longer pays
    for loading the infrared base integration (feedback from Copilot).

  • Tested on: TCL 49C2US TV via Broadlink RM4 remote (power, volume, source commands verified working)

  • This PR fixes or closes issue: fixes #

  • This PR is related to issue: This PR is a follow up to previous PR which was reverted

  • Link to documentation pull request: Document Broadlink Infrared integration support home-assistant.io#44968

  • Link to developer documentation pull request:

  • Link to frontend pull request:

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:

Copilot AI review requested due to automatic review settings April 23, 2026 10:07
@home-assistant home-assistant Bot added cla-signed has-tests integration: broadlink new-feature new-platform Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage labels Apr 23, 2026
@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @Danielhiversen, @felipediel, @L-I-Am, @eifinger, mind taking a look at this pull request as it has been labeled with an integration (broadlink) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of broadlink 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 broadlink 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 Broadlink RM-series IR emitter support to Home Assistant’s native infrared platform, enabling Broadlink devices to transmit infrared_protocols commands through a dedicated infrared entity.

Changes:

  • Add a new Broadlink infrared platform entity that encodes raw timings into Broadlink IR packets and sends them via send_data.
  • Forward Platform.INFRARED only for IR-capable Broadlink RM device types.
  • Add translations and tests covering entity creation, command sending, and error translation behavior.

Reviewed changes

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

File Description
homeassistant/components/broadlink/infrared.py Implements Broadlink InfraredEntity that converts timings to Broadlink packets and transmits them.
homeassistant/components/broadlink/const.py Adds Platform.INFRARED to the forwarded platforms for RM device types.
homeassistant/components/broadlink/strings.json Adds entity name translation and a translated exception message for send failures.
tests/components/broadlink/test_infrared.py Adds tests for IR entity setup, send behavior, and error translation mapping.

Comment thread homeassistant/components/broadlink/infrared.py
@YuvalWS YuvalWS force-pushed the broadlink-infrared-followup branch from 0319c03 to 7a44b47 Compare April 23, 2026 15:09
@YuvalWS YuvalWS marked this pull request as ready for review April 23, 2026 15:25
@YuvalWS YuvalWS requested a review from Danielhiversen as a code owner April 23, 2026 15:25
Copilot AI review requested due to automatic review settings April 23, 2026 15: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 4 out of 4 changed files in this pull request and generated no new comments.

def __init__(self, device: BroadlinkDevice) -> None:
"""Initialize the entity."""
super().__init__(device)
self._attr_unique_id = f"{device.unique_id}-infrared"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we don't need to add infrared as unique ids are unique per integration pet platform

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@joostlek joostlek added this to the 2026.5.0b0 milestone Apr 23, 2026
Copy link
Copy Markdown
Member

@abmantis abmantis left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor suggestions

Comment thread homeassistant/components/broadlink/infrared.py Outdated
Comment thread homeassistant/components/broadlink/strings.json Outdated
]
assert len(infrared_entities) == 1
assert infrared_entities[0].unique_id == device.mac
assert mock_setup.api.auth.call_count == 1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
assert mock_setup.api.auth.call_count == 1

is this related to the infrared platform?

Comment thread tests/components/broadlink/test_infrared.py
@home-assistant home-assistant Bot marked this pull request as draft April 28, 2026 21:29
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Comment thread homeassistant/components/broadlink/infrared.py Outdated
Copilot AI review requested due to automatic review settings April 29, 2026 15:55
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 4 out of 4 changed files in this pull request and generated no new comments.

@YuvalWS YuvalWS marked this pull request as ready for review April 29, 2026 16:41
@home-assistant home-assistant Bot requested a review from abmantis April 29, 2026 16:41
Copy link
Copy Markdown
Member

@abmantis abmantis left a comment

Choose a reason for hiding this comment

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

Thanks!

@abmantis abmantis merged commit ee88b6a into home-assistant:dev Apr 29, 2026
36 of 37 checks passed
@edenhaus edenhaus removed this from the 2026.5.0b0 milestone Apr 29, 2026
@edenhaus edenhaus added this to the 2026.5.0 milestone Apr 30, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cherry-picked cla-signed has-tests integration: broadlink new-feature new-platform Quality Scale: No score Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants