@@ -84,16 +84,18 @@ void BrewService::loopMash(time_t timeNow)
8484 {
8585 Serial.println (" Step over" );
8686 unsigned int nextMashStep = _activeMashStepIndex + 1 ;
87- if (_mashSettings->get <JsonArray>(" steps" ).size () >= nextMashStep)
87+ if (_mashSettings->get <JsonArray>(" steps" ).size () > nextMashStep)
8888 {
89- Serial.println (" Next step: " );
9089 JsonObject &step = _mashSettings->get <JsonArray>(" steps" )[nextMashStep];
9190 _activeMashStepIndex = nextMashStep;
9291 _startTime = 0 ;
9392 _endTime = 0 ;
9493 _targetTemperature = step[" temperature" ];
95- Serial.print (" Next step: " );
96- Serial.println (nextMashStep);
94+ Serial.print (" Next step name: " );
95+ Serial.printf (step[" name" ]);
96+ Serial.println (" " );
97+ Serial.println (" Next step temperature: " );
98+ Serial.printf (step[" temperature" ]);
9799 }
98100 else
99101 {
@@ -108,21 +110,19 @@ void BrewService::loopMash(time_t timeNow)
108110 {
109111 Serial.print (" Temperature: " );
110112 Serial.println (getTemperature ());
111- Serial.println (" " );
112113 Serial.print (" Target: " );
113114 Serial.println (_targetTemperature);
114115 if (_startTime == 0 && (getTemperature () >= (_targetTemperature - 0.2 )))
115116 {
116117 Serial.println (" Step Started" );
117118 JsonObject &step = _mashSettings->get <JsonArray>(" steps" )[_activeMashStepIndex];
118119 _startTime = timeNow;
119- _endTime = timeNow + int (step[" time" ]);
120+ _endTime = timeNow + ( int (step[" time" ]) * 60 );
120121
121122 Serial.print (" Start time: " );
122123 Serial.println (_startTime);
123124 Serial.print (" End Time: " );
124125 Serial.println (_endTime);
125- Serial.println (" " );
126126 // recirculation
127127 }
128128 }
@@ -135,7 +135,7 @@ void BrewService::loopBoil(time_t timeNow)
135135 return ;
136136 }
137137
138- if (_startTime == 0 && _targetTemperature >= 95 ) // get from settings
138+ if (_startTime == 0 && getTemperature () >= _targetTemperature ) // get from settings
139139 {
140140 LoadBoilSettings ();
141141 _startTime = timeNow;
@@ -150,6 +150,7 @@ void BrewService::loopBoil(time_t timeNow)
150150 _startTime = 0 ;
151151 _endTime = 0 ;
152152 _activeStep = none;
153+ _brewStarted = false ;
153154 return ;
154155 }
155156
0 commit comments