const pushSwitch = flux.controls.find(control => control.name === "Momentary Switch");
if (pushSwitch.value) {
flux.currentSymbol = "push-closed";
flux.simulationModel = {type: "switch", state: true};
} else {
flux.currentSymbol = "push-open";
flux.simulationModel = {type: "switch", state: false};
}
flux.on("inputChange", (e) => {
if (e.control_name === "Momentary Switch") {
if (e.value) {
flux.currentSymbol = "push-closed";
flux.simulationModel = {type: "switch", state: true};
} else {
flux.currentSymbol = "push-open";
flux.simulationModel = {type: "switch", state: false};
}
}
});