support reboot
This commit is contained in:
parent
4fff644a1f
commit
1ad90b515e
3 changed files with 126 additions and 476 deletions
|
|
@ -1,4 +1,5 @@
|
|||
const _ = require('lodash/fp')
|
||||
const axios = require('axios')
|
||||
|
||||
const db = require('./db')
|
||||
const pairing = require('./pairing')
|
||||
|
|
@ -48,10 +49,16 @@ function unpair (rec) {
|
|||
return pairing.unpair(rec.deviceId)
|
||||
}
|
||||
|
||||
function reboot (rec) {
|
||||
return axios.post(`http://localhost:3030/reboot?device_id=${rec.deviceId}`)
|
||||
}
|
||||
|
||||
function setMachine (rec) {
|
||||
console.log('DEBUG100: %j', rec.action)
|
||||
switch (rec.action) {
|
||||
case 'resetCashOutBills': return resetCashOutBills(rec)
|
||||
case 'unpair': return unpair(rec)
|
||||
case 'reboot': return reboot(rec)
|
||||
default: throw new Error('No such action: ' + rec.action)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue