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",
"version": "0.0.6",
"version": "0.0.7",
"description": "A node-red node for PiGPIOd",
"dependencies" : {
"js-pigpio": "*"

View File

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