fix blink node fade times...

This commit is contained in:
Dave Conway-Jones 2016-02-04 21:03:43 +00:00
parent 6c3dbbbfbb
commit 9539c3674f
3 changed files with 5 additions and 3 deletions

View File

@ -22,7 +22,7 @@
</div>
<div class="form-row">
<label for="node-input-fade"><i class="fa fa-signal"></i> Fade (mS)</label>
<input type="text" id="node-input-fade" placeholder="500">
<input type="text" id="node-input-fade" placeholder="between 0 and 60,000 mS (1 min)">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
@ -32,7 +32,7 @@
<script type="text/x-red" data-help-name="blink1">
<p>ThingM Blink1 output node.</p>
<p>Expects a <b>msg.payload</b> with either a three part csv string of
<p>Expects a <b>msg.payload</b> with either a three part csv string of
<i>r,g,b</i> or a hex colour <i>#rrggbb</i></p>
<p>You can also use the <a href="http://www.cheerlights.com/control-cheerlights" target="_new">@cheerlights</a>
colour names - red, green, blue, cyan, magenta, yellow, orange, pink,

View File

@ -24,6 +24,8 @@ module.exports = function(RED) {
this.serial = n.serial;
if (!this.serial) { delete this.serial; }
this.fade = Number(n.fade) || 500;
if (this.fade < 0) { this.fade = 0; }
if (this.fade > 60000) { this.fade = 60000; }
var node = this;
try {

View File

@ -3,7 +3,7 @@
"version" : "0.0.12",
"description" : "A Node-RED node to control a Thingm Blink(1)",
"dependencies" : {
"node-blink1" : "0.2.2"
"node-blink1" : "0.2.3"
},
"repository" : {
"type":"git",