Skip to content

Commit

Permalink
Fix model detection and remove serial_number if not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Jan 26, 2025
1 parent 9708066 commit 06ae3bf
Show file tree
Hide file tree
Showing 8 changed files with 553 additions and 389 deletions.
14 changes: 6 additions & 8 deletions components/tc_bus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

CommandData = tc_bus_ns.struct(f"CommandData")
SettingData = tc_bus_ns.struct(f"SettingData")
DeviceData = tc_bus_ns.struct(f"DeviceData")
ModelData = tc_bus_ns.struct(f"ModelData")

IdentifyCompleteTrigger = tc_bus_ns.class_("IdentifyCompleteTrigger", automation.Trigger.template())
IdentifyTimeoutTrigger = tc_bus_ns.class_("IdentifyTimeoutTrigger", automation.Trigger.template())
Expand Down Expand Up @@ -86,7 +86,7 @@

CONF_MODELS = [
"None",
"TCS ISW3030 / Koch TC50",
"TCS ISW3030 / Koch TC50 / Scantron Stilux",
"TCS ISW3130 / Koch TC50P",
"TCS ISW3230 / Koch TC50 GFA",
"TCS ISW3330 / Koch TC50 BW",
Expand Down Expand Up @@ -119,20 +119,18 @@
"TCS TC2000",
"TCS TC20P",
"TCS TC20F",
"TCS ISH3340",
"TCS ISH3022 / Koch TCH50P",
"TCS ISH3130 / Koch TCH50P",
"TCS ISW3022",
"TCS ISH3130 / Koch TCH50P / Scantron LuxPlus",
"TCS ISH3230 / Koch TCH50 GFA",
"TCS ISH3030 / Koch TCH50",
"TCS ISH3030 / Koch TCH50 / Scantron Lux2",
"TCS ISH1030 / Koch TTS25",
"TCS IMM1000 / Koch TCH30",
"TCS IMM1100 / Koch TCHE30",
"TCS IMM1300 / Koch VTCH30",
"TCS IMM1500",
"TCS IMM1310 / Koch VTCHE30",
"TCS IMM1110 / Koch TCHEE30",
"TCS IVH3222 / Koch VTCH50",
"TCS IVH3222 / Koch VTCH50 / Scantron VLux",
"TCS IVH4222 / Koch VTCH50/2D",
"TCS IVW2220 / Koch Sky",
"TCS IVW2221 / Koch Sky R1.00",
Expand Down Expand Up @@ -257,7 +255,7 @@ async def to_code(config):

for conf in config.get(CONF_ON_IDENTIFY_COMPLETE, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [(DeviceData, "x")], conf)
await automation.build_automation(trigger, [(ModelData, "x")], conf)

for conf in config.get(CONF_ON_IDENTIFY_TIMEOUT, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
Expand Down
4 changes: 2 additions & 2 deletions components/tc_bus/automation.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ namespace esphome
parent->add_identify_timeout_callback([this]() { this->trigger(); });
}
};
class IdentifyCompleteTrigger : public Trigger<DeviceData> {
class IdentifyCompleteTrigger : public Trigger<ModelData> {
public:
explicit IdentifyCompleteTrigger(TCBusComponent *parent) {
parent->add_identify_complete_callback([this](const DeviceData &value) { this->trigger(value); });
parent->add_identify_complete_callback([this](const ModelData &value) { this->trigger(value); });
}
};
} // namespace tc_bus
Expand Down
54 changes: 0 additions & 54 deletions components/tc_bus/identifiers.txt

This file was deleted.

Loading

0 comments on commit 06ae3bf

Please sign in to comment.