2
0

feat(icons): change icons

This commit is contained in:
Pierre CLEMENT
2018-01-03 15:36:23 +01:00
parent 8a40a6ad54
commit 92ccef1492
23 changed files with 515 additions and 18 deletions

View File

@@ -42,13 +42,13 @@ Tip: use the configurator from the side-panel (hamburger menu, configuration nod
### How to use different nodes
Here an example of how to use the different nodes:
Here an example of how to use the different nodes (screenshot of [importable flows-overview.json](flows-overview.json "Mi Devices overview")):
![Mi devices example in node-red](resources/mi-devices-overview.png?raw=true "Mi devices example in node-red")
### Sample flows
Here are different flow (screenshot of [importable sample-flows.json](sample-flows.json "Different flows using Mi Devices")):
Here are different flow (screenshot of [importable flows-sample.json](flows-sample.json "Different flows using Mi Devices")):
![Mi devices example in node-red](resources/mi-devices-sample.png?raw=true "Mi devices flow sample")
## Enable LAN mode
@@ -79,7 +79,7 @@ If you change here something, you lose your password!
- [ ] Add filter on "all" node
- [ ] Set action status when no token available
- [ ] Add gateway status
- [ ] Update icons
- [X] Update icons
- [X] Refactor socket and add on/off actions
- [X] Add device SID in output
- [X] Remove different output styles
@@ -92,3 +92,13 @@ If you change here something, you lose your password!
* [louisZl Gateway Local API](https://github.com/louisZL/lumi-gateway-local-api)
* [Domoticz Gateway Code](https://github.com/domoticz/domoticz/blob/development/hardware/XiaomiGateway.cpp)
* [Node-red UDP nodes](https://github.com/node-red/node-red/blob/master/nodes/core/io/32-udp.js)
## Credits
* [Switch icons by Setyo Ari Wibowo](https://thenounproject.com/seochan.art/)
* ["All" icon by Fatahillah](https://thenounproject.com/fatahillah/)
* [Bulb icon by Mello](https://thenounproject.com/stonuiiuntk/)
* [Glasses icon by Agrahara](https://thenounproject.com/agrahara4/)
* [Volume icons by krishna](https://thenounproject.com/krishanayuga/)
* [List icon by Landan Lloyd](https://thenounproject.com/landan/)
* [Clicks icons by Adrien Coquet](https://thenounproject.com/coquet_adrien/)

475
flows-overview.json Normal file
View File

@@ -0,0 +1,475 @@
[
{
"id": "a27cc591.60157",
"type": "tab",
"label": "Flow 1"
},
{
"id": "98fadf6b.93ace8",
"type": "xiaomi-gateway in",
"z": "a27cc591.60157",
"name": "",
"gateway": "",
"ip": "",
"x": 100,
"y": 260,
"wires": [
[
"81afc500.7aaa3",
"cb33991f.f28cf",
"c99b4545.b1c2a",
"64dca666.0bfbd",
"89e83211.c691b",
"76067c35.ffa28c"
]
]
},
{
"id": "81afc500.7aaa3",
"type": "xiaomi-ht",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"x": 420,
"y": 120,
"wires": [
[
"b9a37252.56508"
]
]
},
{
"id": "cb33991f.f28cf",
"type": "xiaomi-magnet",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"x": 440,
"y": 180,
"wires": [
[
"b9a37252.56508"
]
]
},
{
"id": "c99b4545.b1c2a",
"type": "xiaomi-motion",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"motionmsg": "",
"nomotionmsg": "",
"output": "0",
"x": 440,
"y": 240,
"wires": [
[
"b9a37252.56508"
]
]
},
{
"id": "64dca666.0bfbd",
"type": "xiaomi-switch",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"outmsg": "{{click}}",
"outmsgdbcl": "{{double_click}}",
"output": "0",
"x": 440,
"y": 300,
"wires": [
[
"b9a37252.56508"
]
]
},
{
"id": "89e83211.c691b",
"type": "xiaomi-gateway",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"x": 440,
"y": 360,
"wires": [
[
"b9a37252.56508"
]
]
},
{
"id": "76067c35.ffa28c",
"type": "xiaomi-plug",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"onmsg": "",
"offmsg": "",
"output": "0",
"x": 430,
"y": 420,
"wires": [
[
"b9a37252.56508"
]
]
},
{
"id": "b9a37252.56508",
"type": "debug",
"z": "a27cc591.60157",
"name": "",
"active": true,
"console": "false",
"complete": "true",
"x": 790,
"y": 280,
"wires": []
},
{
"id": "67b347e2.6a534",
"type": "xiaomi-ht",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"x": 480,
"y": 580,
"wires": [
[
"80913b13.6abde8"
]
]
},
{
"id": "4d7101c0.34b03",
"type": "xiaomi-magnet",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"x": 500,
"y": 640,
"wires": [
[
"80913b13.6abde8"
]
]
},
{
"id": "d693568c.d4361",
"type": "xiaomi-motion",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"motionmsg": "",
"nomotionmsg": "",
"output": "0",
"x": 500,
"y": 700,
"wires": [
[
"80913b13.6abde8"
]
]
},
{
"id": "698abb61.5abd4c",
"type": "xiaomi-switch",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"outmsg": "{{click}}",
"outmsgdbcl": "{{double_click}}",
"output": "0",
"x": 500,
"y": 760,
"wires": [
[
"80913b13.6abde8",
"478d086b.03d228",
"15e41dc2.040d2a"
]
]
},
{
"id": "7d859dfb.4b9654",
"type": "xiaomi-gateway",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"x": 500,
"y": 820,
"wires": [
[
"80913b13.6abde8",
"70587543.82d5e4",
"575fa4d4.fc33a4",
"ebe3b7c3.e992a",
"1d0a8872.4d0768"
]
]
},
{
"id": "a5e8199.79366e8",
"type": "inject",
"z": "a27cc591.60157",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"x": 100,
"y": 700,
"wires": [
[
"67b347e2.6a534",
"4d7101c0.34b03",
"d693568c.d4361",
"698abb61.5abd4c",
"7d859dfb.4b9654",
"14721d5a.c43ffb",
"c537654a.b43598",
"2c89de3d.6e4982",
"e4012d10.dc47b8"
]
]
},
{
"id": "14721d5a.c43ffb",
"type": "xiaomi-plug",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"sid": "",
"onmsg": "",
"offmsg": "",
"output": "0",
"x": 490,
"y": 880,
"wires": [
[
"80913b13.6abde8",
"66151627.9213d8",
"373c3dc7.ca5912"
]
]
},
{
"id": "c537654a.b43598",
"type": "xiaomi-plug-wifi",
"z": "a27cc591.60157",
"name": "",
"ip": "",
"onmsg": "",
"offmsg": "",
"output": "0",
"x": 500,
"y": 940,
"wires": [
[]
]
},
{
"id": "80913b13.6abde8",
"type": "xiaomi-actions read",
"z": "a27cc591.60157",
"name": "",
"x": 810,
"y": 580,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "70587543.82d5e4",
"type": "xiaomi-actions get_id_list",
"z": "a27cc591.60157",
"name": "",
"x": 820,
"y": 800,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "575fa4d4.fc33a4",
"type": "xiaomi-actions gateway_light",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"brightness": 100,
"hexRgbColor": "#ffffff",
"color": {
"red": 255,
"green": 255,
"blue": 255
},
"x": 820,
"y": 840,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "ebe3b7c3.e992a",
"type": "xiaomi-actions gateway_sound",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"mid": "",
"volume": "",
"x": 830,
"y": 880,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "1d0a8872.4d0768",
"type": "xiaomi-actions gateway_stop_sound",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"x": 830,
"y": 920,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "66151627.9213d8",
"type": "xiaomi-actions on",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"x": 820,
"y": 980,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "373c3dc7.ca5912",
"type": "xiaomi-actions off",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"x": 820,
"y": 1020,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "478d086b.03d228",
"type": "xiaomi-actions click",
"z": "a27cc591.60157",
"name": "",
"x": 810,
"y": 680,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "15e41dc2.040d2a",
"type": "xiaomi-actions double_click",
"z": "a27cc591.60157",
"name": "",
"x": 830,
"y": 720,
"wires": [
[
"70314d8a.34e17c"
]
]
},
{
"id": "70314d8a.34e17c",
"type": "xiaomi-gateway out",
"z": "a27cc591.60157",
"name": "",
"gateway": "",
"ip": "",
"x": 1200,
"y": 780,
"wires": []
},
{
"id": "2c89de3d.6e4982",
"type": "xiaomi-actions on",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"x": 280,
"y": 920,
"wires": [
[
"c537654a.b43598"
]
]
},
{
"id": "e4012d10.dc47b8",
"type": "xiaomi-actions off",
"z": "a27cc591.60157",
"gateway": "",
"name": "",
"x": 280,
"y": 960,
"wires": [
[
"c537654a.b43598"
]
]
},
{
"id": "f475f762.1c84a",
"type": "comment",
"z": "a27cc591.60157",
"name": "Filter incoming",
"info": "",
"x": 420,
"y": 40,
"wires": []
},
{
"id": "1692dd61.5f4893",
"type": "comment",
"z": "a27cc591.60157",
"name": "Outgoing",
"info": "",
"x": 420,
"y": 500,
"wires": []
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -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";
}

View File

@@ -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);

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

View File

@@ -10,7 +10,7 @@
outputs: 1,
outputLabels: ["All devices"],
paletteLabel: "all",
icon: "xiaomi-all-icon.png",
icon: "mi-all.png",
label: function () {
return this.name || "xiaomi-all";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -81,7 +81,7 @@
inputs:0,
outputs:1,
paletteLabel: "gateway in",
icon: "bridge-dash.png",
icon: "mijia-io.png",
label: function() {
return this.name||"xiaomi-gateway";
},
@@ -142,7 +142,7 @@
inputs:1,
outputs:0,
paletteLabel: "gateway out",
icon: "bridge-dash.png",
icon: "mijia-io.png",
align: "right",
label: function() {
return this.name||"xiaomi-gateway";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

View File

@@ -13,7 +13,7 @@
inputs: 1,
outputs: 1,
paletteLabel: "switch",
icon: "light-icon.png",
icon: "mi-switch.png",
label: function () {
return this.name || "xiaomi-switch";
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 78 KiB