From b341acd04d87585886f330b278c533646d9fca13 Mon Sep 17 00:00:00 2001 From: biddster Date: Mon, 30 Jan 2017 22:27:46 +0000 Subject: [PATCH 1/4] prep 0.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 27763ef..1720cef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-hs100", - "version": "0.1.0", + "version": "0.2.0", "description": "", "main": "index.js", "devDependencies": { From b23c279d4c519f5c93b7364b5e2e166afed04c80 Mon Sep 17 00:00:00 2001 From: biddster Date: Tue, 31 Jan 2017 20:04:10 +0000 Subject: [PATCH 2/4] Create README.md --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6cdc092 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# node-red-contrib-hs100 + +This Node-RED node is for controlling tp-link Wi-Fi Smart Plug - Model HS100. + +This node has only been tested with a HS100(UK). The HS100 is also available in US and EU plug versions. We expect they will work too. + +This node simply wraps the excellent work here https://github.com/czjs2/hs100-api. + +# Installation + +Change directory to your node red installation: + + $ npm install node-red-contrib-schedex + +Alternatively, use the Palette Manager in Node-RED. + +# Configuration + +Drag this node on to a worksheet and double click it. Enter the IP address of the plug on your network. Save and deploy. + +To turn the HS100 on, send a message a message with the topic or payload set to `on`. + +To turn the HS100 off, send a message a message with the topic or payload set to `off`. From e057bf323354dd737d1653629ee114a8107e8f00 Mon Sep 17 00:00:00 2001 From: biddster Date: Tue, 31 Jan 2017 20:08:14 +0000 Subject: [PATCH 3/4] Update readme and text. --- README.md | 2 +- index.html | 2 +- index.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6cdc092..9a734a3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This node simply wraps the excellent work here https://github.com/czjs2/hs100-ap Change directory to your node red installation: - $ npm install node-red-contrib-schedex + $ npm install node-red-contrib-schedex Alternatively, use the Palette Manager in Node-RED. diff --git a/index.html b/index.html index 4b04a8d..eeffe9a 100644 --- a/index.html +++ b/index.html @@ -48,7 +48,7 @@
- +
diff --git a/index.js b/index.js index 43003fb..e35a0df 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,7 @@ module.exports = function (RED) { var plug = client.getPlug({host: config.host}); node.on('input', function (msg) { - var state = msg.payload === 'on'; + var state = (msg.payload === 'on' || msg.topic === 'on'); plug.setPowerState(state); node.status({ fill: 'green', diff --git a/package.json b/package.json index 1720cef..3062807 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.2.0", "description": "", "main": "index.js", + "keywords": ["node-red", "tp-link", "tplink", "hs100"], "devDependencies": { "chai": "^3.0.0", "markdown-to-html": "0.0.13", @@ -21,7 +22,6 @@ "type": "git", "url": "https://github.com/biddster/node-red-contrib-hs100.git" }, - "dependencies": { "fx-hs100-api": "^0.3.0" }, From 184dada499d5a9477cae639af8106a4a36c4706e Mon Sep 17 00:00:00 2001 From: biddster Date: Tue, 31 Jan 2017 23:54:31 +0000 Subject: [PATCH 4/4] Update readme. --- index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/index.html b/index.html index eeffe9a..df53179 100644 --- a/index.html +++ b/index.html @@ -55,5 +55,20 @@ \ No newline at end of file