Skip to content

Commit dc13290

Browse files
committed
Some usage clarifications
1 parent 112a3ab commit dc13290

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

io/emoncms/88-emoncms.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,21 @@
2424
<input type="text" id="node-input-topic" placeholder="">
2525
</div>
2626
<div class="form-row">
27-
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
28-
<input type="text" id="node-input-name" placeholder="Emoncms">
27+
<label for="node-input-nodegroup"><i class="icon-tag"></i> Node Group</label>
28+
<input type="text" id="node-input-nodegroup" placeholder="">
2929
</div>
3030
<div class="form-row">
31-
<label for="node-input-nodegroup"><i class="icon-tag"></i> Node</label>
32-
<input type="text" id="node-input-nodegroup" placeholder="">
31+
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
32+
<input type="text" id="node-input-name" placeholder="Emoncms">
3333
</div>
34-
<div class="form-tips">If Topic is left blank the output Topic is the same as the input Topic.</div>
34+
<div class="form-tips">Topic is not mandatory, if Topic is left blank <b>msg.topic</b> will used. Topic overrides <b>msg.topic</b></br>
35+
Node Group (numeric) is not mandatory, if Node Group is left blank <b>msg.nodegrpup</b> will used. Node Group overrides <b>msg.nodegroup</b></div>
3536
</script>
3637

3738
<script type="text/x-red" data-help-name="emoncms">
3839
<p>Performs post to Emoncms.</p>
39-
<p>The Topic is not mandatory, if Topic is left blank <b>msg.topic</b> will used.</p>
40-
<p>The Node is not mandatory, (numberic)</p>
40+
<p>Topic is not mandatory, if Topic is left blank <b>msg.topic</b> will used. Topic overrides <b>msg.topic</b></p>
41+
<p>Node Group (numeric) is not mandatory, if Node Group is left blank <b>msg.nodegrpup</b> will used. Node overrides <b>msg.nodegrpup</b></p>
4142
</script>
4243

4344
<script type="text/javascript">

io/emoncms/88-emoncms.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ function Emoncms(n) {
4040
this.on("input", function(msg) {
4141

4242
var topic = this.topic || msg.topic;
43+
var nodegroup = this.nodegroup || msg.nodegroup;
4344
this.url = this.baseurl + '/input/post.json?json={' + topic + ':' + msg.payload+'}&apikey='+this.apikey;
44-
if(this.nodegroup != ""){
45-
this.url += '&node='+this.nodegroup;
45+
if(nodegroup != ""){
46+
this.url += '&node='+nodegroup;
4647
}
4748
node.log("[emoncms] "+this.url);
4849
http.get(this.url, function(res) {

0 commit comments

Comments
 (0)