This commit is contained in:
Max 2020-10-10 17:37:24 +01:00
parent 5f2a549387
commit 62c585d11f

View File

@ -49,7 +49,23 @@ app.post('/setlight', async function (request, responce) {
responce.send({ success: false, error: "NETWORK" })
})
.then(() => {
responce.send({ success: true, error: false })
axios({
url: 'http://192.168.0.27:5000/setState',
method: 'post',
data: {
power: led_array.power,
brightness: led_array.brightness,
color: led_array.color
}
})
.catch((err) => {
console.error(err)
responce.send({ success: false, error: "NETWORK" })
})
.then(() => {
responce.send({ success: true, error: false })
})
})
}