Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Oct 25, 2024
1 parent 196f46c commit fc76eb3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions components/tc_bus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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())
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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]))
Expand Down
2 changes: 1 addition & 1 deletion components/tc_bus/tc_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions components/tc_bus/tc_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ namespace esphome
};

#ifdef USE_SELECT
class ModelSelect : public select::Select, public Parented<TCBusComponent> {
class IntercomModelSelect : public select::Select, public Parented<TCBusComponent> {
public:
ModelSelect() = default;
IntercomModelSelect() = default;
protected:
void control(const std::string &value) override;
};
Expand Down

0 comments on commit fc76eb3

Please sign in to comment.