diff --git a/esphome/components/duco/duco.cpp b/esphome/components/duco/duco.cpp index 553a20839a..4564c7d7b1 100644 --- a/esphome/components/duco/duco.cpp +++ b/esphome/components/duco/duco.cpp @@ -189,7 +189,5 @@ void Duco::debug_hex(std::vector bytes, uint8_t separator) { delay(10); } -void Duco::add_sensor_item(DucoDevice *sensor) { sensor->set_parent(this); } - } // namespace duco } // namespace esphome diff --git a/esphome/components/duco/duco.h b/esphome/components/duco/duco.h index 910ab02499..3c8586686c 100644 --- a/esphome/components/duco/duco.h +++ b/esphome/components/duco/duco.h @@ -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 waiting_for_response; void stop_waiting(uint8_t message_id); diff --git a/esphome/components/duco/select/__init__.py b/esphome/components/duco/select/__init__.py index d3d3573946..e005a28609 100644 --- a/esphome/components/duco/select/__init__.py +++ b/esphome/components/duco/select/__init__.py @@ -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)) diff --git a/esphome/components/duco/text_sensor/__init__.py b/esphome/components/duco/text_sensor/__init__.py index befb32c73f..c8c4d761ef 100644 --- a/esphome/components/duco/text_sensor/__init__.py +++ b/esphome/components/duco/text_sensor/__init__.py @@ -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))