integrate max power for fermenter hysteresis from test plugin into cbpi4

This commit is contained in:
avollkopf 2024-01-13 16:31:15 +01:00
parent 60afd70dfe
commit 10d76bc398
3 changed files with 12 additions and 8 deletions

View file

@ -1,3 +1,3 @@
__version__ = "4.3.2.a3"
__version__ = "4.3.2.a4"
__codename__ = "Winter Storm"

View file

@ -156,14 +156,14 @@ class StepController:
logging.info("BREWING COMPLETE")
async def previous(self):
logging.info("Trigger Next")
logging.info("Trigger Previous")
async def next(self):
logging.info("Trigger Next")
print("\n\n\n\n")
print(self.profile)
print("\n\n\n\n")
#print("\n\n\n\n")
#print(self.profile)
#print("\n\n\n\n")
step = self.find_by_status(StepState.ACTIVE)
if step is not None:
if step.instance is not None:

View file

@ -46,6 +46,8 @@ class FermenterAutostart(CBPiExtension):
Property.Number(label="HeaterOffsetOff", configurable=True, description="Offset as decimal number when the heater is switched off. Should be smaller then 'HeaterOffsetOn'. For example a value of 1 switches off the heater if the current temperature is 1 degree below the target temperature"),
Property.Number(label="CoolerOffsetOn", configurable=True, description="Offset as decimal number when the cooler is switched on. Should be greater then 'CoolerOffsetOff'. For example a value of 2 switches on the cooler if the current temperature is 2 degrees above the target temperature"),
Property.Number(label="CoolerOffsetOff", configurable=True, description="Offset as decimal number when the cooler is switched off. Should be smaller then 'CoolerOffsetOn'. For example a value of 1 switches off the cooler if the current temperature is 1 degree above the target temperature"),
Property.Number(label="HeaterMaxPower", configurable=True,description="Max Power [%] for Heater (default: 100)"),
Property.Number(label="CoolerMaxPower", configurable=True ,description="Max Power [%] for Cooler (default: 100)"),
Property.Select(label="AutoStart", options=["Yes","No"],description="Autostart Fermenter on cbpi start"),
Property.Sensor(label="sensor2",description="Optional Sensor for LCDisplay(e.g. iSpindle)")])
@ -57,7 +59,9 @@ class FermenterHysteresis(CBPiFermenterLogic):
self.heater_offset_max = float(self.props.get("HeaterOffsetOff", 0))
self.cooler_offset_min = float(self.props.get("CoolerOffsetOn", 0))
self.cooler_offset_max = float(self.props.get("CoolerOffsetOff", 0))
self.heater_max_power = int(self.props.get("HeaterMaxPower", 100))
self.cooler_max_power = int(self.props.get("CoolerMaxPower", 100))
self.fermenter = self.get_fermenter(self.id)
self.heater = self.fermenter.heater
self.cooler = self.fermenter.cooler
@ -81,7 +85,7 @@ class FermenterHysteresis(CBPiFermenterLogic):
if sensor_value + self.heater_offset_min <= target_temp:
if self.heater and (heater_state == False):
await self.actor_on(self.heater)
await self.actor_on(self.heater, self.heater_max_power)
if sensor_value + self.heater_offset_max >= target_temp:
if self.heater and (heater_state == True):
@ -89,7 +93,7 @@ class FermenterHysteresis(CBPiFermenterLogic):
if sensor_value >= self.cooler_offset_min + target_temp:
if self.cooler and (cooler_state == False):
await self.actor_on(self.cooler)
await self.actor_on(self.cooler, self.cooler_max_power)
if sensor_value <= self.cooler_offset_max + target_temp:
if self.cooler and (cooler_state == True):