mirror of
https://github.com/Manuel83/craftbeerpi3
synced 2026-08-10 02:55:27 +02:00
Merge branch 'master' into patch2
This commit is contained in:
@@ -234,6 +234,7 @@ class BoilStep(StepBase):
|
||||
self.check_hop_timer(4, self.hop_4)
|
||||
self.check_hop_timer(5, self.hop_5)
|
||||
self.check_fining_timer(self.fining)
|
||||
|
||||
# Check if timer finished and go to next step
|
||||
if self.is_timer_finished() == True:
|
||||
self.notify("Boil Step Completed!", "Starting the next step", timeout=None)
|
||||
|
||||
@@ -36,10 +36,10 @@ class GPIOSimple(ActorBase):
|
||||
class GPIOPWM(ActorBase):
|
||||
|
||||
gpio = Property.Select("GPIO", options=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27], description="GPIO to which the actor is connected")
|
||||
duty_cylce = Property.Number("Duty Cycle", configurable=True)
|
||||
frequency = Property.Number("Frequency (Hz)", configurable=True)
|
||||
|
||||
p = None
|
||||
power = 100
|
||||
power = 100 # duty cycle
|
||||
|
||||
def init(self):
|
||||
GPIO.setup(int(self.gpio), GPIO.OUT)
|
||||
@@ -50,10 +50,10 @@ class GPIOPWM(ActorBase):
|
||||
if power is not None:
|
||||
self.power = int(power)
|
||||
|
||||
if self.duty_cylce is None:
|
||||
duty_cylce = 50
|
||||
if self.frequency is None:
|
||||
self.frequency = 0.5 # 2 sec
|
||||
|
||||
self.p = GPIO.PWM(int(self.gpio), int(self.duty_cylce))
|
||||
self.p = GPIO.PWM(int(self.gpio), float(self.frequency))
|
||||
self.p.start(int(self.power))
|
||||
|
||||
def set_power(self, power):
|
||||
|
||||
@@ -139,7 +139,7 @@ class FermenterController(ControllerBase, ActorController, SensorController):
|
||||
def heater_on(self, power=100):
|
||||
f = self.api.cache.get("fermenter").get(self.fermenter_id)
|
||||
if f.heater is not None:
|
||||
self.actor_on(int(f.heater))
|
||||
self.actor_on(power, int(f.heater))
|
||||
|
||||
@cbpi.try_catch(None)
|
||||
def heater_off(self):
|
||||
|
||||
@@ -77,6 +77,7 @@ class FermenterView(BaseView):
|
||||
|
||||
def _post_put_callback(self, m):
|
||||
m.state = False
|
||||
self.reset(int(m.id))
|
||||
|
||||
@route('/<int:id>/targettemp/<temp>', methods=['POST'])
|
||||
def postTargetTemp(self, id, temp):
|
||||
|
||||
Reference in New Issue
Block a user