feat(icons): change icons
BIN
node-red-contrib-xiaomi-actions/icons/mi-bulb.png
Normal file
|
After Width: | Height: | Size: 1016 B |
BIN
node-red-contrib-xiaomi-actions/icons/mi-click.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
node-red-contrib-xiaomi-actions/icons/mi-double-click.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
node-red-contrib-xiaomi-actions/icons/mi-list.png
Normal file
|
After Width: | Height: | Size: 601 B |
BIN
node-red-contrib-xiaomi-actions/icons/mi-mute.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
node-red-contrib-xiaomi-actions/icons/mi-off.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
node-red-contrib-xiaomi-actions/icons/mi-on.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
node-red-contrib-xiaomi-actions/icons/mi-read.png
Normal file
|
After Width: | Height: | Size: 990 B |
BIN
node-red-contrib-xiaomi-actions/icons/mi-sound.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
@@ -33,7 +33,7 @@
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
paletteLabel: "read",
|
||||
icon: "function.png",
|
||||
icon: "mi-read.png",
|
||||
label: function() {
|
||||
return this.name||"read";
|
||||
}
|
||||
@@ -68,7 +68,7 @@
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
paletteLabel: "get id list",
|
||||
icon: "function.png",
|
||||
icon: "mi-list.png",
|
||||
label: function() {
|
||||
return this.name||"get id list";
|
||||
}
|
||||
@@ -119,7 +119,7 @@
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
paletteLabel: "click",
|
||||
icon: "function.png",
|
||||
icon: "mi-click.png",
|
||||
label: function() {
|
||||
return this.name||"click";
|
||||
}
|
||||
@@ -169,7 +169,7 @@
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
paletteLabel: "double click",
|
||||
icon: "function.png",
|
||||
icon: "mi-double-click.png",
|
||||
label: function() {
|
||||
return this.name||"double click";
|
||||
}
|
||||
@@ -192,7 +192,7 @@
|
||||
inputs: 1,
|
||||
outputs: 1,
|
||||
paletteLabel: "set light",
|
||||
icon: "light-icon.png",
|
||||
icon: "mi-bulb.png",
|
||||
label: function () {
|
||||
return this.name || "set light";
|
||||
},
|
||||
@@ -279,7 +279,7 @@
|
||||
inputs: 1,
|
||||
outputs: 1,
|
||||
paletteLabel: "play sound",
|
||||
icon: "function.png",
|
||||
icon: "mi-sound.png",
|
||||
label: function () {
|
||||
return this.name || "play sound";
|
||||
}
|
||||
@@ -365,7 +365,7 @@
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
paletteLabel: "stop sound",
|
||||
icon: "function.png",
|
||||
icon: "mi-mute.png",
|
||||
label: function() {
|
||||
return this.name||"stop sound";
|
||||
}
|
||||
@@ -407,7 +407,7 @@
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
paletteLabel: "on",
|
||||
icon: "function.png",
|
||||
icon: "mi-on.png",
|
||||
label: function() {
|
||||
return this.name||"power on";
|
||||
}
|
||||
@@ -449,7 +449,7 @@
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
paletteLabel: "off",
|
||||
icon: "function.png",
|
||||
icon: "mi-off.png",
|
||||
label: function() {
|
||||
return this.name||"power off";
|
||||
}
|
||||
|
||||
@@ -111,7 +111,13 @@ module.exports = (RED) => {
|
||||
this.gateway = RED.nodes.getNode(config.gateway);
|
||||
|
||||
this.on('input', (msg) => {
|
||||
miDevicesUtils.sendWritePayloadToGateway(this, msg, { status: "on", sid: msg.sid});
|
||||
if(msg.sid){
|
||||
miDevicesUtils.sendWritePayloadToGateway(this, msg, { status: "on", sid: msg.sid});
|
||||
}
|
||||
else {
|
||||
msg.payload = "off";
|
||||
this.send(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("xiaomi-actions on", XiaomiActionPowerOn);
|
||||
@@ -124,7 +130,13 @@ module.exports = (RED) => {
|
||||
this.gateway = RED.nodes.getNode(config.gateway);
|
||||
|
||||
this.on('input', (msg) => {
|
||||
miDevicesUtils.sendWritePayloadToGateway(this, msg, { status: "off", sid: msg.sid});
|
||||
if(msg.sid){
|
||||
miDevicesUtils.sendWritePayloadToGateway(this, msg, { status: "off", sid: msg.sid});
|
||||
}
|
||||
else {
|
||||
msg.payload = "off";
|
||||
this.send(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("xiaomi-actions off", XiaomiActionPowerOff);
|
||||
|
||||