mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Add dim command
This commit is contained in:
@@ -232,8 +232,8 @@ module.exports = function(RED) {
|
||||
HAT.close(this,done);
|
||||
});
|
||||
var handleTextMessage = function(line,msg) {
|
||||
var textCol = colours.getRGB(msg.color||msg.colour);
|
||||
var backCol = colours.getRGB(msg.background);
|
||||
var textCol = colours.getRGB(msg.color||msg.colour)||"255,255,255";
|
||||
var backCol = colours.getRGB(msg.background)||"0,0,0";
|
||||
var speed = null;
|
||||
if (!isNaN(msg.speed)) {
|
||||
speed = msg.speed;
|
||||
@@ -245,6 +245,7 @@ module.exports = function(RED) {
|
||||
command += ","+backCol;
|
||||
}
|
||||
}
|
||||
|
||||
if (speed) {
|
||||
var s = parseInt(speed);
|
||||
if (s >= 1 && s <= 5) {
|
||||
@@ -325,6 +326,8 @@ module.exports = function(RED) {
|
||||
command = line.toUpperCase();
|
||||
} else if (/^F(H|V)$/i.test(line)) {
|
||||
command = line.toUpperCase();
|
||||
} else if (/^D(0|1)$/i.test(line)) {
|
||||
command = line.toUpperCase();
|
||||
} else {
|
||||
command = handleTextMessage(line,msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user