diff --git a/phasectrl.py b/phasectrl.py index d869e00..ba24437 100644 --- a/phasectrl.py +++ b/phasectrl.py @@ -24,10 +24,10 @@ def load_phase(json): def fallback(v): return json.get(v, '#t') return Phase( - json['name'], json['text'], - onexit=fallback('onexit'), - onload=fallback('onload'), - nextcond=fallback('nextcond')) + json['name'], json['description'], + onexit=fallback('on_exit'), + onload=fallback('on_load'), + nextcond=fallback('exit_condition')) def load_recipe(json): return Recipe( diff --git a/recipes.json b/recipes.json index fc93594..3c12a96 100644 --- a/recipes.json +++ b/recipes.json @@ -8,11 +8,10 @@ "phases": [ { "name": "Hold", - "text": "Keep 23\u00b0C", - "nextcond": "(> (time-in-this-phase) (hours 10))", - "current": false, - "onload": "(begin (set-controller \"heater\" \"T_food\")\n(set-target \"T_food\" 23.0))", - "onexit": "#t" + "description": "Keep 23\u00b0C", + "exit_condition": "(> (time-in-this-phase) (hours 10))", + "on_load": "(begin (set-controller \"heater\" \"T_food\")\n(set-target \"T_food\" 23.0))", + "on_exit": "#t" } ] }, @@ -25,11 +24,10 @@ "phases": [ { "name": "Hold", - "text": "Keep 35\u00b0C", - "nextcond": "(> (time-in-this-phase) (hours 20))", - "current": false, - "onload": "(begin (set-controller \"heater\" \"T_food\")\n(set-target \"T_food\" 35.0))", - "onexit": "#t" + "description": "Keep 35\u00b0C", + "exit_condition": "(> (time-in-this-phase) (hours 20))", + "on_load": "(begin (set-controller \"heater\" \"T_food\")\n(set-target \"T_food\" 35.0))", + "on_exit": "#t" } ] }, @@ -42,40 +40,36 @@ "phases": [ { "name": "Riscalda", - "text": "Preheat yogurt to 82\u00b0", - "nextcond": "#t", - "current": false, - "onload": "#t", - "onexit": "#t" + "description": "Preheat yogurt to 82°C", + "exit_condition": "(and (>= (get-sensor \"T_food\") 81.5)\n(> (time-in-this-phase) (minutes 15)))", + "on_load": "(begin (set-controller \"heater\" \"T_food\")\n(set-target \"T_food\" 82.0))", + "on_exit": "#t" }, { "name": "Cool", - "text": "Cool to 46\u00b0", - "nextcond": "(and (< (get-sensor \"T_food\") 46.0)\n(> (get-sensor \"T_food\") 42.0))", - "current": false, - "onload": "(set-target \"T_food\" 46.0)", - "onexit": "#t" + "description": "Cool to 46°C", + "exit_condition": "(and (< (get-sensor \"T_food\") 46.0)\n(> (get-sensor \"T_food\") 42.0))", + "on_load": "(set-target \"T_food\" 46.0)", + "on_exit": "#t" }, { - "name": "Inoculate", - "text": "Add 50ml Yogurt", - "nextcond": "(manual-intervention \"Inocula 50g di yogurt\" '((\"Fatto\" #t)))", - "current": false, - "onload": "(notify \"Inoculate 50g of yogurt NOW!\")", - "onexit": "(notify (concat \"Inoculated at \" (now)))" + "name": "Inoculate (backslopping)", + "description": "Add 50ml Yogurt", + "exit_condition": "(manual-intervention \"Inocula 50g di yogurt\" '((\"Fatto\" #t)))", + "on_load": "(notify \"Inoculate 50g of yogurt NOW!\")", + "on_exit": "(notify (concat \"Inoculated at \" (now)))" }, { "name": "Hold", - "text": "Keep at 42\u00b0 for 3h", - "nextcond": "(> (time-in-this-phase) (hours 3))", - "current": false, - "onload": "(set-target \"T_food\" 41.0)", - "onexit": "(notify \"You can remove the yogurt from the heater\")" + "description": "Keep at 42°C for 3h", + "exit_condition": "(> (time-in-this-phase) (hours 3))", + "on_load": "(set-target \"T_food\" 41.0)", + "on_exit": "(notify \"You can remove the yogurt from the heater\")" } ] }, { - "name": "Natt\u014d", + "name": "Nattō", "description": "FIXME", "controllers": [ "(make-duty-controller \"heater\" 0.20 120)"