// Howdy 👋.
// If you are new to writing code in Flux make sure to check out our get started docs: https://docs.flux.ai/reference/introduction
// We also have a Flux Slack Community in case you need help: https://join.slack.com/t/fluxcommunity/shared_invite/zt-p48n941f-wzQ06kGmuFJ2HXnGYT1JkA
// To infinity and beyond 🚀
const p1TerminalId = "0860dc5d-facf-3e33-1d57-6791399c1fa3"; //P1
const p2TerminalId = "020cf3fc-777c-d543-49b3-8c4a9fc59854"; //P2
const p1Terminal = flux.getNodeById(p1TerminalId, "elementTerminal");
const p2Terminal = flux.getNodeById(p2TerminalId, "elementTerminal");
flux.on("setup", () => {
const pushSwitch = flux.controls.find(control => control.name === "Momentary Switch");
if (pushSwitch?.value) {
flux.currentSymbol = "push-button-closed";
flux.simulationModel = simModel(true);
} else {
flux.currentSymbol = "push-button-open";
flux.simulationModel = simModel(false);
}
});