replasing 'got' with 'request' package;
UI for garden watering (start/stop);
This commit is contained in:
@@ -7,7 +7,7 @@ var con = mysql.createConnection({
|
||||
database : 'iot'
|
||||
});
|
||||
|
||||
const got = require('got');
|
||||
//const got = require('got');
|
||||
|
||||
exports.findByName = function(fieldName, days, cb) {
|
||||
process.nextTick(function() {
|
||||
@@ -44,7 +44,7 @@ exports.getFromDht = function(url, cb)
|
||||
{
|
||||
(async () => {
|
||||
try {
|
||||
const dht = await got('http://192.168.1.126/json')
|
||||
//! const dht = await got('http://192.168.1.126/json')
|
||||
var j = JSON.parse(body);
|
||||
if(j.dht && j.dht.hum <= 100 && j.dht.hum >= 0){
|
||||
exports.insert(0, "A23_DHT", dht.body, cb);
|
||||
|
||||
Reference in New Issue
Block a user