Hi,
I am trying to make a node to control some digital outputs. I am facing a problem, because my digital outputs have the possibility to use external voltage reference. I have made the node, but I cannot seem to find a way for implementing a feature for when I select the node to be external voltage or not, to update all the nodes with that option in my current flow.
Here is my "edit dialoag" html code
<div class="form-row">
<label for="node-input-vexternal"><i class="fa fa-plug"></i></i><span data-i18n="digital-outputs.label.source"></span></label>
<select type="text" id="node-input-vexternal">
<option value="no" data-i18n="digital-outputs.ext_v.no"></option>
<option value="yes" data-i18n="digital-outputs.ext_v.yes"></option>
</select>
</div>
Here is my .js code the node.
if(this.v_external === "yes") {
fs.writeFileSync(ENA_V_DO_path, '0');
}
else if(this.v_external === "no") {
fs.writeFileSync(ENA_V_DO_path, '1');
}
}
I was thinking something like adding the oneditprepare to poll the directories ENA_V_DO_path. But I dont know if its is possible to use nodejs filesystem api inside the oneditprepare object.