mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
fix topic to be clear what it is (gpio not pin)
This commit is contained in:
parent
8fa4fbef5f
commit
67fee810eb
@ -56,7 +56,7 @@ module.exports = function(RED) {
|
||||
for (var i = 0; i < d.length; i++) {
|
||||
if (d[i] === '') { return; }
|
||||
if (node.running && node.buttonState !== -1 && !isNaN(Number(d[i])) && node.buttonState !== d[i]) {
|
||||
node.send({ topic:"pi/"+node.pin, payload:Number(d[i]) });
|
||||
node.send({ topic:"gpio/"+node.pin, payload:Number(d[i]) });
|
||||
}
|
||||
node.buttonState = d[i];
|
||||
node.status({fill:"green",shape:"dot",text:d[i]});
|
||||
@ -97,7 +97,7 @@ module.exports = function(RED) {
|
||||
if (node.intype == "up") { val = 1; }
|
||||
if (node.intype == "down") { val = 0; }
|
||||
setTimeout(function() {
|
||||
node.send({ topic:"pi/"+node.pin, payload:val });
|
||||
node.send({ topic:"gpio/"+node.pin, payload:val });
|
||||
node.status({fill:"grey",shape:"dot",text:RED._("rpi-gpio.status.na",{value:val})});
|
||||
},250);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
<dt>payload <span class="property-type">number</span></dt>
|
||||
<dd>the payload will be a 1 or a 0.</dd>
|
||||
<dt>topic <span class="property-type">string</span></dt>
|
||||
<dd>the topic will be set to <code>pi/{the pin number}</code>.</dd>
|
||||
<dd>the topic will be set to <code>gpio/{the bcm spio number}</code>.</dd>
|
||||
</dl>
|
||||
<h3>Details</h3>
|
||||
<p>You may also enable the input pullup resistor or the pulldown resistor.</p>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<dt>payload <span class="property-type">数値</span></dt>
|
||||
<dd>ペイロードには、0 または 1 が設定されます。</dd>
|
||||
<dt>topic <span class="property-type">文字列</span></dt>
|
||||
<dd>トピックには、<code>pi/{ピン番号}</code>が設定されます。</dd>
|
||||
<dd>トピックには、<code>gpio/{ピン番号}</code>が設定されます。</dd>
|
||||
</dl>
|
||||
<h3>詳細</h3>
|
||||
<p>入力のプルアップ抵抗またはプルダウン抵抗を有効にすることもできます。</p>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<dt>payload <span class="property-type">수치</span></dt>
|
||||
<dd>페이로드에는, 0 또는 1이 설정됩니다.</dd>
|
||||
<dt>topic <span class="property-type">문자열</span></dt>
|
||||
<dd>토픽에는, <code>pi/{핀 번호}</code>가 설정됩니다.</dd>
|
||||
<dd>토픽에는, <code>gpio/{핀 번호}</code>가 설정됩니다.</dd>
|
||||
</dl>
|
||||
<h3>상세</h3>
|
||||
<p>입력의 풀 업 저항 또는, 풀 다운 저항을 유효화 할 수도 있습니다.</p>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-node-pi-gpio",
|
||||
"version": "1.3.0",
|
||||
"version": "2.0.0-beta2",
|
||||
"description": "The basic Node-RED node for Pi GPIO",
|
||||
"dependencies" : {
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user