Update
This commit is contained in:
parent
5f2a549387
commit
62c585d11f
@ -49,7 +49,23 @@ app.post('/setlight', async function (request, responce) {
|
|||||||
responce.send({ success: false, error: "NETWORK" })
|
responce.send({ success: false, error: "NETWORK" })
|
||||||
})
|
})
|
||||||
.then(() => {
|
.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 })
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user