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

@ -96,6 +96,8 @@ function poll (req, res, next) {
const reboot = pid && state.reboots?.[operatorId]?.[deviceId] === pid
const shutdown = pid && state.shutdowns?.[operatorId]?.[deviceId] === pid
const restartServices = pid && state.restartServicesMap?.[operatorId]?.[deviceId] === pid
const emptyUnit = pid && state.emptyUnit?.[operatorId]?.[deviceId] === pid
const refillUnit = pid && state.refillUnit?.[operatorId]?.[deviceId] === pid
const langs = localeConfig.languages
const locale = {
@ -119,6 +121,8 @@ function poll (req, res, next) {
reboot,
shutdown,
restartServices,
emptyUnit,
refillUnit,
hasLightning,
receipt,
operatorInfo,