Took 13 minutes
This commit is contained in:
Tobias Hopp 2022-11-22 00:22:52 +01:00
parent d6c219beb7
commit c933b9943d
2 changed files with 10 additions and 2 deletions

View File

@ -53,8 +53,15 @@ export class iTender {
return this._status;
}
static startFill() {
static async startFill(data: { drink: IDrink, ingredients?: { id: String, amount: number }[], amount?: number }) {
// todo Fill method
let drink = await Drink.findById(data.drink);
if(!drink)
return;
iTender.setStatus(iTenderStatus.FILLING);
// todo
// End

View File

@ -9,6 +9,7 @@ import {SensorType} from "../../SensorType";
import {Settings} from "../../Settings";
import Ingredient from "../../database/Ingredient";
import {RequestType} from "../../RequestType";
import {IDrink} from "../../database/IDrink";
const express = require('express');
const router = express.Router();
@ -44,7 +45,7 @@ router.ws('/', async (ws, req, next) => {
switch (msg.event) {
case WebSocketEvent.FILL : {
iTender.setStatus(iTenderStatus.FILLING);
iTender.startFill(msg.data as { drink: IDrink, ingredients?: { id: String, amount: number }[], amount?: number });
break;
}