diff --git a/components/tc_bus/__init__.py b/components/tc_bus/__init__.py index d7ce985..bc56313 100644 --- a/components/tc_bus/__init__.py +++ b/components/tc_bus/__init__.py @@ -7,6 +7,7 @@ AUTO_LOAD = ["binary_sensor", "text_sensor", "select"] CODEOWNERS = ["@azoninc"] + tc_bus_ns = cg.esphome_ns.namespace("tc_bus") TCBus = tc_bus_ns.class_("TCBusComponent", cg.Component) @@ -29,7 +30,7 @@ CommandData = tc_bus_ns.struct(f"CommandData") SettingData = tc_bus_ns.struct(f"SettingData") -ModelSelect = tc_bus_ns.class_("ModelSelect", select.Select, cg.Component) +IntercomModelSelect = tc_bus_ns.class_("IntercomModelSelect", select.Select, cg.Component) ReadMemoryCompleteTrigger = tc_bus_ns.class_("ReadMemoryCompleteTrigger", automation.Trigger.template()) ReadMemoryTimeoutTrigger = tc_bus_ns.class_("ReadMemoryTimeoutTrigger", automation.Trigger.template()) @@ -134,7 +135,7 @@ def validate_config(config): cv.Optional(CONF_SERIAL_NUMBER, default=0): cv.hex_uint32_t, cv.Optional(CONF_SERIAL_NUMBER_LAMBDA): cv.returning_lambda, cv.Optional(CONF_MODEL): select.select_schema( - ModelSelect, + IntercomModelSelect, entity_category=ENTITY_CATEGORY_CONFIG, ), cv.Optional(CONF_BUS_COMMAND): text_sensor.text_sensor_schema( @@ -189,7 +190,7 @@ async def to_code(config): options=[MODELS], ) await cg.register_parented(sel, config[CONF_ID]) - cg.add(var.set_model_select(sel)) + cg.add(var.set_intercom_model_select(sel)) if CONF_SERIAL_NUMBER in config: cg.add(var.set_sn(config[CONF_SERIAL_NUMBER])) diff --git a/components/tc_bus/tc_bus.cpp b/components/tc_bus/tc_bus.cpp index 348279f..4c4a880 100644 --- a/components/tc_bus/tc_bus.cpp +++ b/components/tc_bus/tc_bus.cpp @@ -671,7 +671,7 @@ namespace esphome } #ifdef USE_SELECT - void ModelSelect::control(const std::string &value) + void IntercomModelSelect::control(const std::string &value) { this->intercom_model_select_->publish_state(value); diff --git a/components/tc_bus/tc_bus.h b/components/tc_bus/tc_bus.h index c0e69cf..edbbd85 100644 --- a/components/tc_bus/tc_bus.h +++ b/components/tc_bus/tc_bus.h @@ -146,9 +146,9 @@ namespace esphome }; #ifdef USE_SELECT - class ModelSelect : public select::Select, public Parented { + class IntercomModelSelect : public select::Select, public Parented { public: - ModelSelect() = default; + IntercomModelSelect() = default; protected: void control(const std::string &value) override; };