--- a/brewco/brewco.h Sat Nov 28 13:47:00 2015 +0100 +++ b/brewco/brewco.h Sat Nov 28 20:15:38 2015 +0100 @@ -115,6 +115,8 @@ int version; /* Record version */ char *uuid; /* uuid code */ char *name; /* Unit name */ + int number; /* Unit number */ + int active; /* 0/1 active unit */ sensor_var *hlt_sensor; /* HLT sensor */ switch_var *hlt_heater; /* HLT heater */ int hlt_heater_mltfirst; /* HLT heater MLT high priority */ @@ -272,4 +274,36 @@ +/* + * Brewing state file ~/.brewco/var/brewing.xml + * If present a brew session is running + */ + +#define MAISH_NA 0 /* Not in any state yet */ +#define MASIH_PROMPT 1 /* Prompt the user */ +#define MAISH_HEATING 2 /* Heating phase */ +#define MAISH_REST 3 /* Rest phase */ +#define MAISH_DONE 4 /* This step is done */ + + +typedef struct _brew_session { + char *uuid_recipe; /* Brewing this recipe */ + char *uuid_unit; /* Brewing unit */ + int premash; /* In premash state */ + int mashstep; /* In or into maishstep or -1 */ + int mashstate; /* State this step is in */ + int resttime; /* Rest time downcouner */ + int iodine; /* Mash iodine test */ + int mashremove; /* Mash remove step */ + int boilheating; /* Heat for boiling */ + int boiling; /* Boiling started */ + int boiltimer; /* Boiling downcount */ + int cooling; /* Cooling phase */ + int whirlpool; /* Whirlpool phase */ + int cleanup; /* Cleanup phase */ + time_t starttime; /* Start of brew */ + time_t endtime; /* End of brew */ +} brew_session; + + #endif