forked from Mirrors/node-red-contrib-mi-devices
mattes-seins
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
# node-red-contrib-mi-devices
|
||||
|
||||
__:warning: I will not go further because I don't use node-red anymore and I don't have the time, but feel free to fork, PR & so on. If you want to maintain this module, feel free to ask.__
|
||||
|
||||
This module contains the following nodes to provide easy integration of the Xiaomi devices into node-red.
|
||||
This module is a fork of [Harald Rietman module, node-red-contrib-xiaomi-devices](https://github.com/hrietman/node-red-contrib-xiaomi-devices)
|
||||
|
||||
|
||||
@@ -79,7 +79,9 @@
|
||||
<div class="form-row">
|
||||
<label for="node-input-onlyModels"><i class="icon-tag"></i> Only</label>
|
||||
<select multiple id="node-input-onlyModels">
|
||||
<option value="sensor_ht,weather.v1">Temperature/humidty</option>
|
||||
<option value="sensor_ht,weather.v1">Temperature/Humidty</option>
|
||||
<option value="natgas">Natgas/Alarm/Density</option>
|
||||
<option value="smoke">Smoke/Alarm/Density</option>
|
||||
<option value="motion">Motion</option>
|
||||
<option value="switch,sensor_switch.aq2">Switches</option>
|
||||
<option value="magnet,sensor_magnet.aq2">Contacts</option>
|
||||
|
||||
BIN
node-red-contrib-xiaomi-configurator/icons/natgas-tw-icon.png
Normal file
BIN
node-red-contrib-xiaomi-configurator/icons/natgas-tw-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
BIN
node-red-contrib-xiaomi-configurator/icons/smoke-tw-icon.png
Normal file
BIN
node-red-contrib-xiaomi-configurator/icons/smoke-tw-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -15,6 +15,8 @@
|
||||
var node = this;
|
||||
|
||||
var tw_sensor_ht = {value:"sensor_ht", label:"sensor ht", icon:"icons/node-red-contrib-mi-devices/thermometer-tw-icon.png"};
|
||||
var tw_natgas = {value:"natgas", label:"natgas", icon:"icons/node-red-contrib-mi-devices/natgas-tw-icon.png"};
|
||||
var tw_smoke = {value:"smoke", label:"smoke", icon:"icons/node-red-contrib-mi-devices/smoke-tw-icon.png"};
|
||||
var tw_magnet = {value:"magnet", label:"contact", icon:"icons/node-red-contrib-mi-devices/door-tw-icon.png"};
|
||||
var tw_motion = {value:"motion", label:"motion", icon:"icons/node-red-contrib-mi-devices/motion-tw-icon.png"};
|
||||
var tw_plug = {value:"plug", label:"plug", icon:"icons/node-red-contrib-mi-devices/outlet-tw-icon.png"};
|
||||
@@ -31,7 +33,7 @@
|
||||
var sid = $('<input/>',{id:"node-config-input-sid-"+i,type:"text", placeholder:"SID", style:"width:auto;vertical-align:top"}).appendTo(row);
|
||||
sid.typedInput({
|
||||
default: 'sensor_ht',
|
||||
types: [tw_sensor_ht, tw_magnet, tw_motion, tw_plug, tw_switch]
|
||||
types: [tw_sensor_ht, tw_natgas, tw_smoke, tw_magnet, tw_motion, tw_plug, tw_switch]
|
||||
});
|
||||
|
||||
$('<label/>',{for:"node-config-input-desc-"+i, style:"margin-left: 7px; width: 20px;vertical-align:middle"}).html('<i class="fa fa-pencil-square-o"></i>').appendTo(row);
|
||||
@@ -114,6 +116,8 @@
|
||||
<p>At the moment the following devices are supported:
|
||||
<lu>
|
||||
<li>Humidity & Temperature sensor [sensor ht/]</li>
|
||||
<li>Natgas sensor [natgas]</li>
|
||||
<li>Smoke sensor [smoke]</li>
|
||||
<li>Body motion sensor [motion]</li>
|
||||
<li>Magnet contact sensor [contact]</li>
|
||||
<li>Wall socket plug (zigbee) [plug]</li>
|
||||
|
||||
BIN
node-red-contrib-xiaomi-natgas/icons/natgas-icon.png
Normal file
BIN
node-red-contrib-xiaomi-natgas/icons/natgas-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
BIN
node-red-contrib-xiaomi-natgas/icons/org_natgas-icon.png
Normal file
BIN
node-red-contrib-xiaomi-natgas/icons/org_natgas-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
131
node-red-contrib-xiaomi-natgas/xiaomi-natgas.html
Normal file
131
node-red-contrib-xiaomi-natgas/xiaomi-natgas.html
Normal file
@@ -0,0 +1,131 @@
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('xiaomi-natgas', {
|
||||
category: 'xiaomi',
|
||||
color: '#3FADB5',
|
||||
defaults: {
|
||||
gateway: {value:"", type:"xiaomi-configurator"},
|
||||
name: {value: ""},
|
||||
sid: {value: "", required: true},
|
||||
natgasmsg: {value: ""},
|
||||
nonatgasmsg: {value: ""},
|
||||
output: {value: "0"}
|
||||
},
|
||||
inputs: 1,
|
||||
outputs: 1,
|
||||
paletteLabel: "natgas",
|
||||
icon: "natgas-icon.png",
|
||||
label: function () {
|
||||
return this.name || "xiaomi-natgas";
|
||||
},
|
||||
oneditprepare: function() {
|
||||
var node = this;
|
||||
|
||||
if(node.sid) {
|
||||
$('#node-input-sid').val(node.sid);
|
||||
}
|
||||
|
||||
function changeGateway(model) {
|
||||
var configNodeID = $('#node-input-gateway').val();
|
||||
if (configNodeID) {
|
||||
var configNode = RED.nodes.node(configNodeID);
|
||||
if(configNode) {
|
||||
$('#node-input-sid').empty();
|
||||
for (key in configNode.deviceList) {
|
||||
var device = configNode.deviceList[key];
|
||||
if (device.model === model) {
|
||||
$('#node-input-sid').append('<option value="' + device.sid + '">' + device.desc + '</option>');
|
||||
}
|
||||
}
|
||||
if(node.sid) {
|
||||
$('#node-input-sid option[value="' + node.sid + '"]').prop('selected', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#node-input-sid").change(function () {
|
||||
if(!this.name) {
|
||||
$("#node-input-name").val($('#node-input-sid option:selected').text());
|
||||
}
|
||||
});
|
||||
$("#node-input-gateway").change(function () {
|
||||
changeGateway("natgas");
|
||||
});
|
||||
},
|
||||
oneditsave: function() {
|
||||
var node = this;
|
||||
node.sid = $("#node-input-sid").val();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-template-name="xiaomi-natgas">
|
||||
<div class="form-row">
|
||||
<label for="node-input-gateway"><i class="icon-tag"></i> Gateway</label>
|
||||
<input type="text" id="node-input-gateway" placeholder="xiaomi gateway">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-sid"><i class="icon-tag"></i> Device</label>
|
||||
<select id="node-input-sid" placeholder="xiaomi gateway"></select>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="xiaomi-natgas">
|
||||
<p>The Xiaomi natgas sensor node</p>
|
||||
|
||||
<h3>Inputs</h3>
|
||||
<dl class="message-properties">
|
||||
<dt>payload
|
||||
<span class="property-type">object</span>
|
||||
</dt>
|
||||
<dd>
|
||||
When the message contains a <code>sid</code> field, the node will filter the input and output only if the <code>sid</code> is the device's sid.<br>
|
||||
<hr>
|
||||
If the message doesn't contain a <code>sid</code> field, the node will be used to inject <code>sid</code> and <code>gateway</code> fields in the incoming <code>msg</code>.<br>
|
||||
<hr>
|
||||
Input Gateway node produces message of type <code>read_ack</code>, <code>heartbeat</code> or <code>report</code>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Outputs</h3>
|
||||
<ol class="node-ports">
|
||||
<dl class="message-properties">
|
||||
<dt>payload <span class="property-type">object</span></dt>
|
||||
<dd>Data from gateway when used as a filter (see below).</dd>
|
||||
<dt>sid <span class="property-type">string</span></dt>
|
||||
<dd>Device SID.</dd>
|
||||
<dt>gateway <span class="property-type">object</span></dt>
|
||||
<dd>The <code>xiaomi-configurator</code> object where the device is registred.</dd>
|
||||
</dl>
|
||||
</ol>
|
||||
|
||||
<h4>Details</h4>
|
||||
<p>The incoming message is processed if the input <code>sid</code> matches the configured value for this device.</p>
|
||||
<p>Sample messages:</p>
|
||||
<p><pre>{
|
||||
cmd: "report"
|
||||
model: "natgas"
|
||||
sid: "158d00015ef56c"
|
||||
short_id: 21672
|
||||
data: {
|
||||
density: "0"
|
||||
}
|
||||
}</pre>
|
||||
<p><pre>{
|
||||
cmd: "heartbeat"
|
||||
model: "natgas"
|
||||
sid: "158d00015ef56c"
|
||||
short_id: 21672
|
||||
data: {
|
||||
voltage: 3035,
|
||||
alarm: "0",
|
||||
batteryLevel: 45
|
||||
}
|
||||
}</pre>
|
||||
Where <code>batteryLevel</code> is a computed percentage of remaining battery.
|
||||
</p>
|
||||
</script>
|
||||
9
node-red-contrib-xiaomi-natgas/xiaomi-natgas.js
Normal file
9
node-red-contrib-xiaomi-natgas/xiaomi-natgas.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const miDevicesUtils = require('../src/utils');
|
||||
|
||||
module.exports = (RED) => {
|
||||
// natgas
|
||||
function XiaomiNatgasNode(config) {
|
||||
miDevicesUtils.defaultNode(RED, config, this);
|
||||
}
|
||||
RED.nodes.registerType("xiaomi-natgas", XiaomiNatgasNode);
|
||||
};
|
||||
BIN
node-red-contrib-xiaomi-smoke/icons/org_smoke-icon.png
Normal file
BIN
node-red-contrib-xiaomi-smoke/icons/org_smoke-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
BIN
node-red-contrib-xiaomi-smoke/icons/smoke-icon.png
Normal file
BIN
node-red-contrib-xiaomi-smoke/icons/smoke-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
131
node-red-contrib-xiaomi-smoke/xiaomi-smoke.html
Normal file
131
node-red-contrib-xiaomi-smoke/xiaomi-smoke.html
Normal file
@@ -0,0 +1,131 @@
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('xiaomi-smoke', {
|
||||
category: 'xiaomi',
|
||||
color: '#3FADB5',
|
||||
defaults: {
|
||||
gateway: {value:"", type:"xiaomi-configurator"},
|
||||
name: {value: ""},
|
||||
sid: {value: "", required: true},
|
||||
smokemsg: {value: ""},
|
||||
nosmokemsg: {value: ""},
|
||||
output: {value: "0"}
|
||||
},
|
||||
inputs: 1,
|
||||
outputs: 1,
|
||||
paletteLabel: "smoke",
|
||||
icon: "smoke-icon.png",
|
||||
label: function () {
|
||||
return this.name || "xiaomi-smoke";
|
||||
},
|
||||
oneditprepare: function() {
|
||||
var node = this;
|
||||
|
||||
if(node.sid) {
|
||||
$('#node-input-sid').val(node.sid);
|
||||
}
|
||||
|
||||
function changeGateway(model) {
|
||||
var configNodeID = $('#node-input-gateway').val();
|
||||
if (configNodeID) {
|
||||
var configNode = RED.nodes.node(configNodeID);
|
||||
if(configNode) {
|
||||
$('#node-input-sid').empty();
|
||||
for (key in configNode.deviceList) {
|
||||
var device = configNode.deviceList[key];
|
||||
if (device.model === model) {
|
||||
$('#node-input-sid').append('<option value="' + device.sid + '">' + device.desc + '</option>');
|
||||
}
|
||||
}
|
||||
if(node.sid) {
|
||||
$('#node-input-sid option[value="' + node.sid + '"]').prop('selected', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#node-input-sid").change(function () {
|
||||
if(!this.name) {
|
||||
$("#node-input-name").val($('#node-input-sid option:selected').text());
|
||||
}
|
||||
});
|
||||
$("#node-input-gateway").change(function () {
|
||||
changeGateway("smoke");
|
||||
});
|
||||
},
|
||||
oneditsave: function() {
|
||||
var node = this;
|
||||
node.sid = $("#node-input-sid").val();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-template-name="xiaomi-smoke">
|
||||
<div class="form-row">
|
||||
<label for="node-input-gateway"><i class="icon-tag"></i> Gateway</label>
|
||||
<input type="text" id="node-input-gateway" placeholder="xiaomi gateway">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="Name">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-sid"><i class="icon-tag"></i> Device</label>
|
||||
<select id="node-input-sid" placeholder="xiaomi gateway"></select>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="xiaomi-smoke">
|
||||
<p>The Xiaomi smoke sensor node</p>
|
||||
|
||||
<h3>Inputs</h3>
|
||||
<dl class="message-properties">
|
||||
<dt>payload
|
||||
<span class="property-type">object</span>
|
||||
</dt>
|
||||
<dd>
|
||||
When the message contains a <code>sid</code> field, the node will filter the input and output only if the <code>sid</code> is the device's sid.<br>
|
||||
<hr>
|
||||
If the message doesn't contain a <code>sid</code> field, the node will be used to inject <code>sid</code> and <code>gateway</code> fields in the incoming <code>msg</code>.<br>
|
||||
<hr>
|
||||
Input Gateway node produces message of type <code>read_ack</code>, <code>heartbeat</code> or <code>report</code>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Outputs</h3>
|
||||
<ol class="node-ports">
|
||||
<dl class="message-properties">
|
||||
<dt>payload <span class="property-type">object</span></dt>
|
||||
<dd>Data from gateway when used as a filter (see below).</dd>
|
||||
<dt>sid <span class="property-type">string</span></dt>
|
||||
<dd>Device SID.</dd>
|
||||
<dt>gateway <span class="property-type">object</span></dt>
|
||||
<dd>The <code>xiaomi-configurator</code> object where the device is registred.</dd>
|
||||
</dl>
|
||||
</ol>
|
||||
|
||||
<h4>Details</h4>
|
||||
<p>The incoming message is processed if the input <code>sid</code> matches the configured value for this device.</p>
|
||||
<p>Sample message:</p>
|
||||
<p><pre>{
|
||||
cmd: "report"
|
||||
model: "smoke"
|
||||
sid: "158d00015ef56c"
|
||||
short_id: 21672
|
||||
data: {
|
||||
density: "0"
|
||||
}
|
||||
}</pre>
|
||||
<p><pre>{
|
||||
cmd: "heartbeat"
|
||||
model: "smoke"
|
||||
sid: "158d00015ef56c"
|
||||
short_id: 21672
|
||||
data: {
|
||||
voltage: 3035,
|
||||
alarm: "0",
|
||||
batteryLevel: 45
|
||||
}
|
||||
}</pre>
|
||||
Where <code>batteryLevel</code> is a computed percentage of remaining battery.
|
||||
</p>
|
||||
</script>
|
||||
9
node-red-contrib-xiaomi-smoke/xiaomi-smoke.js
Normal file
9
node-red-contrib-xiaomi-smoke/xiaomi-smoke.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const miDevicesUtils = require('../src/utils');
|
||||
|
||||
module.exports = (RED) => {
|
||||
// smoke
|
||||
function XiaomiSmokeNode(config) {
|
||||
miDevicesUtils.defaultNode(RED, config, this);
|
||||
}
|
||||
RED.nodes.registerType("xiaomi-smoke", XiaomiSmokeNode);
|
||||
};
|
||||
122
package.json
122
package.json
@@ -1,47 +1,35 @@
|
||||
{
|
||||
"name": "node-red-contrib-mi-devices",
|
||||
"version": "1.1.1",
|
||||
"description": "A set of nodes to control some of the popular Xiaomi sensors which are connected to the Xiaomi Gateway, and the Gateway itself.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com:pierrecle/node-red-contrib-mi-devices.git"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rimraf dist",
|
||||
"build": "npm run clean && npm run build:ts && npm run build:ejs && npm run build:icons",
|
||||
"build:ts": "tsc --allowUnreachableCode -p .",
|
||||
"build:ejs": "npm run build:ejs:indexes",
|
||||
"build:ejs:indexes": "ejs-cli --base-dir src/ --options \"{\\\"NODES_PREFIX\\\": \\\"mi-devices\\\"}\" \"**/index.ejs\" --out dist/",
|
||||
"build:ejs:devices": "ejs-cli --base-dir src/ --options \"{\\\"NODES_PREFIX\\\": \\\"mi-devices\\\"}\" \"nodes/devices/*.ejs\" --out dist/",
|
||||
"build:icons": "npm run build:icons:yeelight",
|
||||
"build:icons:gateway": "cp -pr icons/gateway dist/nodes/gateway/icons",
|
||||
"build:icons:devices": "cp -pr icons/devices dist/nodes/devices/icons",
|
||||
"build:icons:actions": "cp -pr icons/actions dist/nodes/actions/icons",
|
||||
"build:icons:yeelight": "cp -pr icons/yeelight dist/nodes/yeelight/icons"
|
||||
},
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"Xiaomi",
|
||||
"Aqara",
|
||||
"Yeelight",
|
||||
"node-red"
|
||||
"_args": [
|
||||
[
|
||||
"node-red-contrib-mi-devices@1.1.1",
|
||||
"/private/var/node-red"
|
||||
]
|
||||
],
|
||||
"node-red": {
|
||||
"nodes": {
|
||||
"xiaomi-ht": "node-red-contrib-xiaomi-ht/xiaomi-ht.js",
|
||||
"xiaomi-magnet": "node-red-contrib-xiaomi-magnet/xiaomi-magnet.js",
|
||||
"xiaomi-motion": "node-red-contrib-xiaomi-motion/xiaomi-motion.js",
|
||||
"xiaomi-switch": "node-red-contrib-xiaomi-switch/xiaomi-switch.js",
|
||||
"xiaomi-socket": "node-red-contrib-xiaomi-socket/xiaomi-socket.js",
|
||||
"xiaomi-socket-wifi": "node-red-contrib-xiaomi-socket-wifi/xiaomi-socket-wifi.js",
|
||||
"xiaomi-all": "node-red-contrib-xiaomi-all/xiaomi-all.js",
|
||||
"xiaomi-configurator": "node-red-contrib-xiaomi-configurator/xiaomi-configurator.js",
|
||||
"xiaomi-gateway": "node-red-contrib-xiaomi-gateway/xiaomi-gateway.js",
|
||||
"xiaomi-actions": "node-red-contrib-xiaomi-actions/xiaomi-actions.js",
|
||||
"xiaomi-yeelight": "dist/nodes/yeelight/index.js"
|
||||
}
|
||||
"_from": "node-red-contrib-mi-devices@1.1.1",
|
||||
"_id": "node-red-contrib-mi-devices@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-uUizxWcRgjML83O+nfElPoct6q+2cZHLN96gvSagzx7MtEtcVtTz0pUYiebWhNWd4EzM5UvDa9mI7KYHNmIKPg==",
|
||||
"_location": "/node-red-contrib-mi-devices",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "node-red-contrib-mi-devices@1.1.1",
|
||||
"name": "node-red-contrib-mi-devices",
|
||||
"escapedName": "node-red-contrib-mi-devices",
|
||||
"rawSpec": "1.1.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.1.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/node-red-contrib-mi-devices/-/node-red-contrib-mi-devices-1.1.1.tgz",
|
||||
"_spec": "1.1.1",
|
||||
"_where": "/private/var/node-red",
|
||||
"author": {
|
||||
"name": "Pierre CLEMENT"
|
||||
},
|
||||
"author": "Pierre CLEMENT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/pierrecle/node-red-contrib-mi-devices/issues"
|
||||
},
|
||||
@@ -51,14 +39,58 @@
|
||||
"miio": "^0.14.1",
|
||||
"yeelight-wifi": "^2.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.4.5"
|
||||
},
|
||||
"description": "A set of nodes to control some of the popular Xiaomi sensors which are connected to the Xiaomi Gateway, and the Gateway itself.",
|
||||
"devDependencies": {
|
||||
"@types/node-red": "^0.17.1",
|
||||
"ejs": "^2.5.7",
|
||||
"ejs-cli": "^2.0.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"typescript": "^2.6.2"
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.4.5"
|
||||
},
|
||||
"homepage": "https://github.com/pierrecle/node-red-contrib-mi-devices#readme",
|
||||
"keywords": [
|
||||
"Xiaomi",
|
||||
"Aqara",
|
||||
"Yeelight",
|
||||
"node-red"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "node-red-contrib-mi-devices",
|
||||
"node-red": {
|
||||
"nodes": {
|
||||
"xiaomi-ht": "node-red-contrib-xiaomi-ht/xiaomi-ht.js",
|
||||
"xiaomi-natgas": "node-red-contrib-xiaomi-natgas/xiaomi-natgas.js",
|
||||
"xiaomi-smoke": "node-red-contrib-xiaomi-smoke/xiaomi-smoke.js",
|
||||
"xiaomi-magnet": "node-red-contrib-xiaomi-magnet/xiaomi-magnet.js",
|
||||
"xiaomi-motion": "node-red-contrib-xiaomi-motion/xiaomi-motion.js",
|
||||
"xiaomi-switch": "node-red-contrib-xiaomi-switch/xiaomi-switch.js",
|
||||
"xiaomi-socket": "node-red-contrib-xiaomi-socket/xiaomi-socket.js",
|
||||
"xiaomi-socket-wifi": "node-red-contrib-xiaomi-socket-wifi/xiaomi-socket-wifi.js",
|
||||
"xiaomi-all": "node-red-contrib-xiaomi-all/xiaomi-all.js",
|
||||
"xiaomi-configurator": "node-red-contrib-xiaomi-configurator/xiaomi-configurator.js",
|
||||
"xiaomi-gateway": "node-red-contrib-xiaomi-gateway/xiaomi-gateway.js",
|
||||
"xiaomi-actions": "node-red-contrib-xiaomi-actions/xiaomi-actions.js"
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/pierrecle/node-red-contrib-mi-devices.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run clean && npm run build:ts && npm run build:ejs && npm run build:icons",
|
||||
"build:ejs": "npm run build:ejs:indexes",
|
||||
"build:ejs:devices": "ejs-cli --base-dir src/ --options \"{\\\"NODES_PREFIX\\\": \\\"mi-devices\\\"}\" \"nodes/devices/*.ejs\" --out dist/",
|
||||
"build:ejs:indexes": "ejs-cli --base-dir src/ --options \"{\\\"NODES_PREFIX\\\": \\\"mi-devices\\\"}\" \"**/index.ejs\" --out dist/",
|
||||
"build:icons": "npm run build:icons:yeelight",
|
||||
"build:icons:actions": "cp -pr icons/actions dist/nodes/actions/icons",
|
||||
"build:icons:devices": "cp -pr icons/devices dist/nodes/devices/icons",
|
||||
"build:icons:gateway": "cp -pr icons/gateway dist/nodes/gateway/icons",
|
||||
"build:icons:yeelight": "cp -pr icons/yeelight dist/nodes/yeelight/icons",
|
||||
"build:ts": "tsc --allowUnreachableCode -p .",
|
||||
"clean": "rimraf dist"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user