Add RadioFrequencyTransmitterConsumerEntity and migrate consumers#171026
Add RadioFrequencyTransmitterConsumerEntity and migrate consumers#171026balloob wants to merge 2 commits into
Conversation
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>
|
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
|
|
Hey there @piitaya, 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
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 movedasync_send_commandinto a newhelpers.py) to centralize transmitter availability tracking and command sending. - Moved
DATA_COMPONENTintoradio_frequency/const.py. - Migrated
honeywell_string_lightsandnovy_cooker_hoodentities 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. |
Proposed change
Same approach for radio_frequency as #170854 did for infrared.
Move
DATA_COMPONENTtoconst.pyandasync_send_commandto a newhelpers.py, then add aRadioFrequencyTransmitterConsumerEntitybase class that tracks the availability of the underlying RF transmitter entity.Migrate
honeywell_string_lightsandnovy_cooker_hoodto use it, replacing the hand-rolled availability tracking boilerplate in both integrations.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: