feat: add empty and refill unit machine actions

fix: remove certain actions from the state middleware after being consumed by the poller
This commit is contained in:
Sérgio Salgado 2023-05-03 18:26:46 +01:00
parent 2e9bb3c7df
commit 797f074898
10 changed files with 163 additions and 2 deletions

View file

@ -37,6 +37,14 @@ function machineAction (type, value) {
logger.debug(`Restarting services of machine '${deviceId}' from operator ${operatorId}`)
state.restartServicesMap[operatorId] = { [deviceId]: pid }
break
case 'emptyUnit':
logger.debug(`Emptying units from machine '${deviceId}' from operator ${operatorId}`)
state.emptyUnit[operatorId] = { [deviceId]: pid }
break
case 'refillUnit':
logger.debug(`Refilling stackers from machine '${deviceId}' from operator ${operatorId}`)
state.refillUnit[operatorId] = { [deviceId]: pid }
break
default:
break
}

View file

@ -15,6 +15,8 @@ module.exports = (function () {
reboots: {},
shutdowns: {},
restartServicesMap: {},
emptyUnit: {},
refillUnit: {},
mnemonic: null
}
}())