Skip to content

Add RadioFrequencyTransmitterConsumerEntity and migrate consumers#171026

Open
balloob wants to merge 2 commits into
devfrom
radio-frequency-consumer-entity
Open

Add RadioFrequencyTransmitterConsumerEntity and migrate consumers#171026
balloob wants to merge 2 commits into
devfrom
radio-frequency-consumer-entity

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented May 17, 2026

Proposed change

Same approach for radio_frequency as #170854 did for infrared.

Move DATA_COMPONENT to const.py and async_send_command to a new helpers.py, then add a RadioFrequencyTransmitterConsumerEntity base class that tracks the availability of the underlying RF transmitter entity.

Migrate honeywell_string_lights and novy_cooker_hood to use it, replacing the hand-rolled availability tracking boilerplate in both integrations.

Type of change

  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR is related to issue:
  • Link to documentation pull request:
  • 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:

balloob and others added 2 commits May 17, 2026 16:23
Move DATA_COMPONENT to const.py, move async_send_command to a new
helpers.py, and add RadioFrequencyTransmitterConsumerEntity base class
that tracks the availability of the underlying RF transmitter entity.

Mirrors the refactoring done for the infrared integration in #170854.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…uencyTransmitterConsumerEntity

Replace hand-rolled availability tracking in both integrations with
the new RadioFrequencyTransmitterConsumerEntity base class. The base
entity classes now only provide device info.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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 (radio_frequency) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of radio_frequency 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 radio_frequency 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.

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @piitaya, mind taking a look at this pull request as it has been labeled with an integration (novy_cooker_hood) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of novy_cooker_hood 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 novy_cooker_hood 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

This PR introduces a shared helper base class in radio_frequency to reduce boilerplate for integrations that send RF commands via a transmitter entity, and migrates existing consumer integrations to use it.

Changes:

  • Added RadioFrequencyTransmitterConsumerEntity (and moved async_send_command into a new helpers.py) to centralize transmitter availability tracking and command sending.
  • Moved DATA_COMPONENT into radio_frequency/const.py.
  • Migrated honeywell_string_lights and novy_cooker_hood entities to inherit the new consumer base and removed duplicated availability tracking code.

Reviewed changes

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

Show a summary per file
File Description
homeassistant/components/radio_frequency/helpers.py Adds shared RF consumer base class and relocates async_send_command.
homeassistant/components/radio_frequency/const.py Defines DATA_COMPONENT in const.py.
homeassistant/components/radio_frequency/init.py Re-exports moved helpers and updates imports/exports accordingly.
homeassistant/components/novy_cooker_hood/light.py Switches light entity to the shared RF consumer base and routes command sending through it.
homeassistant/components/novy_cooker_hood/fan.py Switches fan entity to the shared RF consumer base and routes command sending through it.
homeassistant/components/novy_cooker_hood/entity.py Removes duplicated availability tracking boilerplate now handled by the shared base.
homeassistant/components/honeywell_string_lights/light.py Switches light entity to the shared RF consumer base and routes command sending through it.
homeassistant/components/honeywell_string_lights/entity.py Removes duplicated availability tracking boilerplate now handled by the shared base.

Comment thread homeassistant/components/radio_frequency/helpers.py
Comment thread homeassistant/components/honeywell_string_lights/light.py
Comment thread homeassistant/components/novy_cooker_hood/light.py
Comment thread homeassistant/components/novy_cooker_hood/fan.py
Comment thread homeassistant/components/radio_frequency/helpers.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants