Skip to content

Commit

Permalink
Dynamically read memory based on the model
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Jan 26, 2025
1 parent e52eb3e commit 9cc49df
Show file tree
Hide file tree
Showing 8 changed files with 546 additions and 381 deletions.
6 changes: 2 additions & 4 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 @@ -119,10 +119,8 @@
"TCS TC2000",
"TCS TC20P",
"TCS TC20F",
"TCS ISH3340",
"TCS ISH3022 / Koch TCH50P",
"TCS ISH3130 / Koch TCH50P / Scantron LuxPlus",
"TCS ISW3022",
"TCS ISH3230 / Koch TCH50 GFA",
"TCS ISH3030 / Koch TCH50 / Scantron Lux2",
"TCS ISH1030 / Koch TTS25",
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 9cc49df

Please sign in to comment.