18 lines
348 B
JavaScript
18 lines
348 B
JavaScript
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
|
|
});
|
|
|
|
},
|
|
} |