update
Took 13 minutes
This commit is contained in:
parent
d6c219beb7
commit
c933b9943d
@ -53,8 +53,15 @@ export class iTender {
|
|||||||
return this._status;
|
return this._status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static startFill() {
|
static async startFill(data: { drink: IDrink, ingredients?: { id: String, amount: number }[], amount?: number }) {
|
||||||
// todo Fill method
|
// todo Fill method
|
||||||
|
let drink = await Drink.findById(data.drink);
|
||||||
|
if(!drink)
|
||||||
|
return;
|
||||||
|
|
||||||
|
iTender.setStatus(iTenderStatus.FILLING);
|
||||||
|
// todo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// End
|
// End
|
||||||
|
@ -9,6 +9,7 @@ import {SensorType} from "../../SensorType";
|
|||||||
import {Settings} from "../../Settings";
|
import {Settings} from "../../Settings";
|
||||||
import Ingredient from "../../database/Ingredient";
|
import Ingredient from "../../database/Ingredient";
|
||||||
import {RequestType} from "../../RequestType";
|
import {RequestType} from "../../RequestType";
|
||||||
|
import {IDrink} from "../../database/IDrink";
|
||||||
|
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
@ -44,7 +45,7 @@ router.ws('/', async (ws, req, next) => {
|
|||||||
|
|
||||||
switch (msg.event) {
|
switch (msg.event) {
|
||||||
case WebSocketEvent.FILL : {
|
case WebSocketEvent.FILL : {
|
||||||
iTender.setStatus(iTenderStatus.FILLING);
|
iTender.startFill(msg.data as { drink: IDrink, ingredients?: { id: String, amount: number }[], amount?: number });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user