cummulative changes

This commit is contained in:
d-popov
2020-06-09 00:38:35 +03:00
parent 8a68a07112
commit 6a8a895f69
5 changed files with 211 additions and 83 deletions

View File

@@ -6,10 +6,11 @@ const got = require('got');
const request = require('request');
function GetDht() {
try {//?
var result;
(async () => {
try {
var ret = await got('http://192.168.1.126/cm?cmnd=status%2010');
var ret = await got('http://192.168.1.126/cm?cmnd=status%2010&user=admin&password=vlado555');
console.log("DHT: "+ util.inspect(ret.body));
var j = JSON.parse(ret.body);
console.log("JSON> " + util.inspect(j));
@@ -26,16 +27,20 @@ function GetDht() {
console.log(error);
}
})();
while(result === undefined) {
require('deasync').runLoopOnce();
}
while(result === undefined) {
require('deasync').runLoopOnce();
}
return result;
} catch(error){
console.log(error);
}
}
exports.SendCmd = function (url, cmd)
{
url = url +"/cm?cmnd=irsend%200,"+cmd;
url = url +"/cm?cmnd=irsend%200,"+cmd+"&user=admin&password=vlado555";
console.log("IR_SEND_RAW:" + url);
(async () => {
try {