mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 09:08:41 +00:00
[infrared,radio_frequency] queue_entity_register before setup_core_
The setup_<X>_core_ functions are decorated with @setup_entity, which calls finalize_entity_strings() before returning. queue_entity_register() must run before that so the combined App.register_<entity>(var, name, hash, packed) emission is selected; otherwise finalize falls back to configure_entity_ and no register call is emitted. Reported by Copilot review on PR #16030.
This commit is contained in:
@@ -54,8 +54,8 @@ async def register_infrared(var: cg.Pvariable, config: ConfigType) -> None:
|
||||
"""Register an infrared device with the core."""
|
||||
cg.add_define("USE_IR_RF")
|
||||
await cg.register_component(var, config)
|
||||
await setup_infrared_core_(var, config)
|
||||
queue_entity_register("infrared", config)
|
||||
await setup_infrared_core_(var, config)
|
||||
CORE.register_platform_component("infrared", var)
|
||||
|
||||
|
||||
|
||||
@@ -55,8 +55,8 @@ async def register_radio_frequency(var: cg.Pvariable, config: ConfigType) -> Non
|
||||
"""Register a radio frequency device with the core."""
|
||||
cg.add_define("USE_RADIO_FREQUENCY")
|
||||
await cg.register_component(var, config)
|
||||
await setup_radio_frequency_core_(var, config)
|
||||
queue_entity_register("radio_frequency", config)
|
||||
await setup_radio_frequency_core_(var, config)
|
||||
CORE.register_platform_component("radio_frequency", var)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user