mirror of
https://github.com/esphome/esphome.git
synced 2024-12-19 16:07:47 +01:00
remote_receiver: use config parent receiver for registering dumpers (#1980)
This commit is contained in:
parent
79b9d0579d
commit
062cedc200
@ -176,7 +176,9 @@ validate_binary_sensor = cv.validate_registry_entry(
|
||||
TRIGGER_REGISTRY = SimpleRegistry()
|
||||
DUMPER_REGISTRY = Registry(
|
||||
{
|
||||
cv.GenerateID(CONF_RECEIVER_ID): cv.use_id(RemoteReceiverBase),
|
||||
cv.Optional(CONF_RECEIVER_ID): cv.invalid(
|
||||
"This has been removed in ESPHome 1.20.0 and the dumper attaches directly to the parent receiver."
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
@ -228,8 +230,6 @@ async def build_dumpers(config):
|
||||
dumpers = []
|
||||
for conf in config:
|
||||
dumper = await cg.build_registry_entry(DUMPER_REGISTRY, conf)
|
||||
receiver = await cg.get_variable(conf[CONF_RECEIVER_ID])
|
||||
cg.add(receiver.register_dumper(dumper))
|
||||
dumpers.append(dumper)
|
||||
return dumpers
|
||||
|
||||
|
@ -54,7 +54,10 @@ async def to_code(config):
|
||||
else:
|
||||
var = cg.new_Pvariable(config[CONF_ID], pin)
|
||||
|
||||
await remote_base.build_dumpers(config[CONF_DUMP])
|
||||
dumpers = await remote_base.build_dumpers(config[CONF_DUMP])
|
||||
for dumper in dumpers:
|
||||
cg.add(var.register_dumper(dumper))
|
||||
|
||||
await remote_base.build_triggers(config)
|
||||
await cg.register_component(var, config)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user