mirror of
https://github.com/esphome/esphome.git
synced 2024-11-29 10:14:13 +01:00
remote_receiver: use config parent receiver for registering dumpers (#1980)
This commit is contained in:
parent
79b9d0579d
commit
062cedc200
2 changed files with 7 additions and 4 deletions
|
@ -176,7 +176,9 @@ validate_binary_sensor = cv.validate_registry_entry(
|
||||||
TRIGGER_REGISTRY = SimpleRegistry()
|
TRIGGER_REGISTRY = SimpleRegistry()
|
||||||
DUMPER_REGISTRY = Registry(
|
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 = []
|
dumpers = []
|
||||||
for conf in config:
|
for conf in config:
|
||||||
dumper = await cg.build_registry_entry(DUMPER_REGISTRY, conf)
|
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)
|
dumpers.append(dumper)
|
||||||
return dumpers
|
return dumpers
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,10 @@ async def to_code(config):
|
||||||
else:
|
else:
|
||||||
var = cg.new_Pvariable(config[CONF_ID], pin)
|
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 remote_base.build_triggers(config)
|
||||||
await cg.register_component(var, config)
|
await cg.register_component(var, config)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue