change: wip testing price from sheet
Signed-off-by: pakintada@gmail.com <Pakin>
This commit is contained in:
parent
3b70cc9fe8
commit
07977ce896
9 changed files with 268 additions and 18 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import { get } from 'svelte/store';
|
||||
import { updateMachineStatus } from '../stores/machineInfoStore';
|
||||
import { addNotification } from '../stores/noti';
|
||||
import { handleIncomingMessages } from './messageHandler';
|
||||
import { recipeFromMachineQuery } from '../stores/recipeStore';
|
||||
|
||||
type AdbPayload = { type: string; payload: any };
|
||||
|
||||
|
|
@ -73,9 +75,21 @@ async function handleAdbPayload(raw_payload: string) {
|
|||
let plist = payload.payload.split('/');
|
||||
let pd = plist[0] ?? '';
|
||||
let total_time = plist[1] ?? '';
|
||||
let mode_ref = plist[2] ?? '';
|
||||
|
||||
// update recipe data store
|
||||
console.log('brewing finish', pd, 'total time', total_time);
|
||||
|
||||
// update recipe from brew now
|
||||
let recipeDevSnapshot = get(recipeFromMachineQuery) ?? {};
|
||||
let recipe01Snap = recipeDevSnapshot['recipe'];
|
||||
if (recipe01Snap) {
|
||||
recipe01Snap[pd].total_time =
|
||||
mode_ref != 'sim' ? total_time : recipe01Snap[pd].total_time;
|
||||
|
||||
recipeDevSnapshot['recipe'] = recipe01Snap;
|
||||
recipeFromMachineQuery.set(recipeDevSnapshot);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue