diff --git a/config.py.EXAMPLE b/config.py.EXAMPLE index 242e505..bf15d37 100644 --- a/config.py.EXAMPLE +++ b/config.py.EXAMPLE @@ -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 diff --git a/lib/oven.py b/lib/oven.py index a294a99..3c37d73 100644 --- a/lib/oven.py +++ b/lib/oven.py @@ -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: