mirror of
https://github.com/esphome/esphome.git
synced 2024-12-31 18:07:48 +01:00
Set parent of components directly
This commit is contained in:
parent
ab65500420
commit
4d535838e4
@ -189,7 +189,5 @@ void Duco::debug_hex(std::vector<uint8_t> bytes, uint8_t separator) {
|
||||
delay(10);
|
||||
}
|
||||
|
||||
void Duco::add_sensor_item(DucoDevice *sensor) { sensor->set_parent(this); }
|
||||
|
||||
} // namespace duco
|
||||
} // namespace esphome
|
||||
|
@ -29,8 +29,6 @@ class Duco : public uart::UARTDevice, public Component {
|
||||
void set_send_wait_time(uint16_t time_in_ms) { send_wait_time_ = time_in_ms; }
|
||||
void set_disable_crc(bool disable_crc) { disable_crc_ = disable_crc; }
|
||||
|
||||
void add_sensor_item(DucoDevice *sensor);
|
||||
|
||||
std::map<uint8_t, DucoDevice *> waiting_for_response;
|
||||
void stop_waiting(uint8_t message_id);
|
||||
|
||||
|
@ -44,4 +44,4 @@ async def to_code(config):
|
||||
await select.register_select(var, config, options=DUCO_MODE_OPTIONS)
|
||||
|
||||
parent = await cg.get_variable(config[CONF_DUCO_ID])
|
||||
cg.add(parent.add_sensor_item(var))
|
||||
cg.add(var.set_parent(parent))
|
||||
|
@ -27,4 +27,4 @@ async def to_code(config):
|
||||
await text_sensor.register_text_sensor(var, config)
|
||||
|
||||
parent = await cg.get_variable(config[CONF_DUCO_ID])
|
||||
cg.add(parent.add_sensor_item(var))
|
||||
cg.add(var.set_parent(parent))
|
||||
|
Loading…
Reference in New Issue
Block a user