fix pumps
Took 8 minutes
This commit is contained in:
parent
6aad142664
commit
b5704f4359
@ -105,7 +105,7 @@ export class iTender {
|
||||
job.estimatedTime = 0;
|
||||
let tolerance = 3;
|
||||
for (let x of amounts) {
|
||||
let c = await Container.findOne({$and: [{enabled: true}, {filled: {$gt: x.amount + tolerance}}]});
|
||||
let c = await Container.findOne({$and: [{enabled: true}, {filled: {$gt: x.amount + tolerance}}, {content: x.ingredient}]});
|
||||
if (!c) {
|
||||
mixLog("Not enough ingredients!");
|
||||
reject(RejectReason.NOT_ENOUGH_INGREDIENTS);
|
||||
@ -118,6 +118,7 @@ export class iTender {
|
||||
|
||||
}
|
||||
|
||||
console.log(amounts);
|
||||
job.drink = drink
|
||||
job.amounts = amounts as { ingredient: IIngredient, amount: number, container: IContainer }[];
|
||||
if( job.estimatedTime < 0.5 )
|
||||
@ -143,7 +144,7 @@ export class iTender {
|
||||
|
||||
let timers: NodeJS.Timeout[] = [];
|
||||
for (let x of job.amounts) {
|
||||
console.log(x);
|
||||
|
||||
// Start pump here
|
||||
try {
|
||||
await MyGPIO.setup(x.container.pumpPin, GPIO.DIR_OUT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user