1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

Better label for piGPIOd node

This commit is contained in:
Dave Conway-Jones 2017-05-24 18:43:44 +01:00
parent 76e33acae5
commit a00fcb3726
No known key found for this signature in database
GPG Key ID: 81B04231572A9A2D
2 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-node-pi-gpiod", "name": "node-red-node-pi-gpiod",
"version": "0.0.6", "version": "0.0.7",
"description": "A node-red node for PiGPIOd", "description": "A node-red node for PiGPIOd",
"dependencies" : { "dependencies" : {
"js-pigpio": "*" "js-pigpio": "*"

View File

@ -455,8 +455,12 @@
align: "right", align: "right",
label: function() { label: function() {
if (this.out === "pwm") { return this.name || "PWM: "+bcm2pin[this.pin]; } if (this.out === "pwm") { return this.name || "PWM: "+bcm2pin[this.pin]; }
if (this.out === "ser") { return this.name || "Servo: "+bcm2pin[this.pin]; } else if (this.out === "ser") { return this.name || "Servo: "+bcm2pin[this.pin]; }
else { return this.name||"PIN: "+bcm2pin[this.pin] ; } else {
var suf = "";
if (this.set == true) { suf = (this.level === "1") ? "¹ " : "₀ "; }
return this.name || "PIN: " + bcm2pin[this.pin] + suf ;
}
}, },
labelStyle: function() { labelStyle: function() {
return this.name?"node_label_italic":""; return this.name?"node_label_italic":"";
@ -465,7 +469,6 @@
palettelabel: "pi gpiod", palettelabel: "pi gpiod",
oneditprepare: function() { oneditprepare: function() {
var pinnow = bcm2pin[this.pin]; var pinnow = bcm2pin[this.pin];
console.log("NOW",pinnow);
var pintip = this._("pi-gpiod.tip.pin"); var pintip = this._("pi-gpiod.tip.pin");
var pinname = this._("pi-gpiod.pinname"); var pinname = this._("pi-gpiod.pinname");
if (!$("#node-input-out").val()) { $("#node-input-out").val("out"); } if (!$("#node-input-out").val()) { $("#node-input-out").val("out"); }