Added config option to invert the polarity of the heater

pull/1/head
Rob Shaw 2016-04-07 15:51:46 +01:00
rodzic 46facc399b
commit 0e14a20cbf
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -26,6 +26,8 @@ gpio_heat = 11 # Switches zero-cross solid-state-relay
gpio_cool = 10 # Regulates PWM for 12V DC Blower
gpio_air = 9 # Switches 0-phase det. solid-state-relay
heater_invert = 0 # switches the polarity of the heater control
### Inputs
gpio_door = 18

Wyświetl plik

@ -146,11 +146,17 @@ class Oven (threading.Thread):
if value:
self.heat = 1.0
if gpio_available:
GPIO.output(config.gpio_heat, GPIO.LOW)
if config.heater_invert:
GPIO.output(config.gpio_heat, GPIO.LOW)
else:
GPIO.output(config.gpio_heat, GPIO.HIGH)
else:
self.heat = 0.0
if gpio_available:
GPIO.output(config.gpio_heat, GPIO.HIGH)
if config.heater_invert:
GPIO.output(config.gpio_heat, GPIO.HIGH)
else:
GPIO.output(config.gpio_heat, GPIO.LOW)
def set_cool(self, value):
if value: