dbej
(dbej)
August 31, 2016, 12:54am
11
A few updates. The status of the outlet should be reflected correctly now when you on/off/refresh the outlet. It will poll the outlet and update the status at the standard polling interval. I also had to add a callback from hubAction to a custom response handler. Calls in to Parse do not seem to be reliable.
Dockerfile
#1. put the files in a folder called hs-100
#2. sudo docker build -t hs-100:latest hs-100/.
#3. run the container
#4. sudo docker run -d -p 8083:8083 -v /etc/localtime:/etc/localtime:ro --restart=always --name hs-100 hs-100:latest
# or
#4. docker run -t -i -p 8083:8083 --entrypoint=/bin/bash --name hs-100 hs-100:latest
#5. docker exec -it hs-100 bash
#6. curl -H "x-hs100-command:on" -H "x-hs100-ip:<plugip>" -D - <gatewayip>:8083
This file has been truncated. show original
hs100.js
var sock = require('net');
var http = require('http');
var url = require('url');
var hs100api = require('hs100-api');
const PORT = 8083;
var server = http.createServer(onRequest);
server.listen(PORT);
console.log("The HS-100 controller has started");
This file has been truncated. show original
package.json
{
"name": "hs-100-api-bridge",
"version": "1.0.0",
"author": "none",
"scripts": {
},
"dependencies": {
"hs100-api":"*"
},
"private":true
This file has been truncated. show original
There are more than three files. show original