diff --git a/hardware/pigpiod/package.json b/hardware/pigpiod/package.json index e5880b5b..2b886b8f 100644 --- a/hardware/pigpiod/package.json +++ b/hardware/pigpiod/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-pi-gpiod", - "version": "0.0.5", + "version": "0.0.6", "description": "A node-red node for PiGPIOd", "dependencies" : { "js-pigpio": "*" diff --git a/hardware/pigpiod/pi-gpiod.html b/hardware/pigpiod/pi-gpiod.html index dbee7a1f..71d0515d 100644 --- a/hardware/pigpiod/pi-gpiod.html +++ b/hardware/pigpiod/pi-gpiod.html @@ -1,37 +1,143 @@ @@ -103,53 +208,169 @@ var suf = ""; if (this.intype === "PUD_UP") { suf = "↑ "} if (this.intype === "PUD_DOWN") { suf = "↓ "} - return this.name || "GPIO: "+suf+bcm2pin[this.pin] ; + return this.name || "PIN: "+suf+bcm2pin[this.pin] ; }, labelStyle: function() { return this.name?"node_label_italic":""; }, + outputLabels: function() { return "GPIO"+this.pin; }, palettelabel: "pi gpiod", oneditprepare: function() { var pinnow = this.pin; var pintip = this._("pi-gpiod.tip.pin"); var pinname = this._("pi-gpiod.pinname"); + $('#pinform input').on('change', function() { + this.pin = $("#pinform input[type='radio']:checked").val(); + $("#node-input-pin").val(this.pin); + }); + $("#node-input-pin").change(function () { + if ($("#node-input-pin").val()) { + $("#pinform input[value="+$("#node-input-pin").val()+"]").prop('checked', true); + } + }); } });