Added setting parameter for Step AutoMode

- Adds more flexibility for users
- Default is yes
This commit is contained in:
avollkopf 2021-06-21 06:51:58 +02:00
parent 3ee23bfa59
commit 4e22e6415e
2 changed files with 26 additions and 10 deletions

View file

@ -57,6 +57,22 @@
"type": "select", "type": "select",
"value": "C" "value": "C"
}, },
"AutoMode": {
"description": "Use AutoMode in steps",
"name": "AutoMode",
"options": [
{
"label": "Yes",
"value": "Yes"
},
{
"label": "No",
"value": "No"
}
],
"type": "select",
"value": "Yes"
},
"steps_boil": { "steps_boil": {
"description": "Boil step type", "description": "Boil step type",
"name": "steps_boil", "name": "steps_boil",

View file

@ -194,7 +194,7 @@ class UploadController:
step_type = self.mashin if self.mashin != "" else "MashInStep" step_type = self.mashin if self.mashin != "" else "MashInStep"
step_string = { "name": "MashIn", step_string = { "name": "MashIn",
"props": { "props": {
"AutoMode": "Yes" if step_type == "MashInStep" else "No", "AutoMode": self.AutoMode,
"Kettle": self.id, "Kettle": self.id,
"Sensor": self.kettle.sensor, "Sensor": self.kettle.sensor,
"Temp": mashin_temp, "Temp": mashin_temp,
@ -211,7 +211,7 @@ class UploadController:
step_type = self.mash if self.mash != "" else "MashStep" step_type = self.mash if self.mash != "" else "MashStep"
step_string = { "name": str(row[0]), step_string = { "name": str(row[0]),
"props": { "props": {
"AutoMode": "Yes" if step_type == "MashStep" else "No", "AutoMode": self.AutoMode,
"Kettle": self.id, "Kettle": self.id,
"Sensor": self.kettle.sensor, "Sensor": self.kettle.sensor,
"Temp": str(int(row[1])) if self.TEMP_UNIT == "C" else str(round(9.0 / 5.0 * int(row[1]) + 32)), "Temp": str(int(row[1])) if self.TEMP_UNIT == "C" else str(round(9.0 / 5.0 * int(row[1]) + 32)),
@ -243,7 +243,7 @@ class UploadController:
step_type = self.boil if self.boil != "" else "BoilStep" step_type = self.boil if self.boil != "" else "BoilStep"
step_string = { "name": "Boil Step", step_string = { "name": "Boil Step",
"props": { "props": {
"AutoMode": "Yes" if step_type == "BoilStep" else "No", "AutoMode": self.AutoMode,
"Kettle": self.id, "Kettle": self.id,
"Sensor": self.kettle.sensor, "Sensor": self.kettle.sensor,
"Temp": int(self.BoilTemp), "Temp": int(self.BoilTemp),
@ -312,7 +312,7 @@ class UploadController:
step_string = { "name": step_name, step_string = { "name": step_name,
"props": { "props": {
"AutoMode": "Yes" if step_type == "MashInStep" or step_type == "MashStep" else "No", "AutoMode": self.AutoMode,
"Kettle": self.id, "Kettle": self.id,
"Sensor": self.kettle.sensor, "Sensor": self.kettle.sensor,
"Temp": step_temp, "Temp": step_temp,
@ -351,7 +351,7 @@ class UploadController:
step_string = { "name": "Boil Step", step_string = { "name": "Boil Step",
"props": { "props": {
"AutoMode": "Yes" if step_type == "BoilStep" else "No", "AutoMode": self.AutoMode,
"Kettle": step_kettle, "Kettle": step_kettle,
"Sensor": sensor, "Sensor": sensor,
"Temp": step_temp, "Temp": step_temp,
@ -449,17 +449,15 @@ class UploadController:
sensor = self.kettle.sensor sensor = self.kettle.sensor
if MashIn_Flag == True and int(step_timer) == 0: if MashIn_Flag == True and int(step_timer) == 0:
step_type = self.mashin if self.mashin != "" else "MashInStep" step_type = self.mashin if self.mashin != "" else "MashInStep"
AutoMode = "Yes" if step_type == "MashInStep" else "No"
Notification = "Target temperature reached. Please add malt." Notification = "Target temperature reached. Please add malt."
MashIn_Flag = False MashIn_Flag = False
else: else:
step_type = self.mash if self.mash != "" else "MashStep" step_type = self.mash if self.mash != "" else "MashStep"
AutoMode = "Yes" if step_type == "MashStep" else "No"
Notification = "" Notification = ""
step_string = { "name": step_name, step_string = { "name": step_name,
"props": { "props": {
"AutoMode": "Yes" if step_type == "MashInStep" or step_type == "MashStep" else "No", "AutoMode": self.AutoMode,
"Kettle": self.id, "Kettle": self.id,
"Sensor": self.kettle.sensor, "Sensor": self.kettle.sensor,
"Temp": step_temp, "Temp": step_temp,
@ -500,7 +498,7 @@ class UploadController:
step_string = { "name": "Boil Step", step_string = { "name": "Boil Step",
"props": { "props": {
"AutoMode": "Yes" if step_type == "BoilStep" else "No", "AutoMode": self.AutoMode,
"Kettle": step_kettle, "Kettle": step_kettle,
"Sensor": sensor, "Sensor": sensor,
"Temp": step_temp, "Temp": step_temp,
@ -628,6 +626,7 @@ class UploadController:
self.kettle = None self.kettle = None
#Define MashSteps #Define MashSteps
self.TEMP_UNIT = self.cbpi.config.get("TEMP_UNIT", "C") self.TEMP_UNIT = self.cbpi.config.get("TEMP_UNIT", "C")
self.AutoMode = self.cbpi.config.get("AutoMode", "Yes")
self.mashin = self.cbpi.config.get("steps_mashin", "MashInStep") self.mashin = self.cbpi.config.get("steps_mashin", "MashInStep")
self.mash = self.cbpi.config.get("steps_mash", "MashStep") self.mash = self.cbpi.config.get("steps_mash", "MashStep")
self.mashout = self.cbpi.config.get("steps_mashout", None) # Currently used only for the Braumeister self.mashout = self.cbpi.config.get("steps_mashout", None) # Currently used only for the Braumeister
@ -654,7 +653,8 @@ class UploadController:
"cooldown": str(self.cooldown), "cooldown": str(self.cooldown),
"boiltemp": str(self.BoilTemp), "boiltemp": str(self.BoilTemp),
"cooldowntemp": str(self.CoolDownTemp), "cooldowntemp": str(self.CoolDownTemp),
"temp_unit": str(self.TEMP_UNIT) "temp_unit": str(self.TEMP_UNIT),
"AutoMode": str(self.AutoMode)
} }
return config_values return config_values