Update
This commit is contained in:
parent
f3228cba8d
commit
07a640abd6
@ -35,6 +35,21 @@ app.post('/setlight', async function (request, responce) {
|
|||||||
led_array.color = Number(request.body.color)
|
led_array.color = Number(request.body.color)
|
||||||
|
|
||||||
// Now make an api call to the led controller
|
// Now make an api call to the led controller
|
||||||
|
|
||||||
|
axios({
|
||||||
|
url: 'http://192.168.0.23: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" })
|
||||||
|
})
|
||||||
|
|
||||||
axios({
|
axios({
|
||||||
url: 'http://192.168.0.27:5000/setState',
|
url: 'http://192.168.0.27:5000/setState',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@ -50,7 +65,7 @@ app.post('/setlight', async function (request, responce) {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
||||||
responce.send({ success: true, error: false })
|
responce.send({ success: true, error: false })
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user