21 lines
449 B
JavaScript
Raw Normal View History

2020-09-12 11:42:02 +01:00
const got = require('got');
module.exports = {
request: async (input) => {
var options = {
json: {
"switch": JSON.stringify(input)
}
};
got.post(`http://192.168.4.5:2020/water/switch`, options)
.then((resp) => {
return resp
});
},
2020-09-14 12:11:37 +01:00
pause: async (time) => {
await new Promise(resolve => setTimeout(resolve, time));
},
2020-09-12 11:42:02 +01:00
}