Permalink
Browse files

Added config option to invert the polarity of the heater

  • Loading branch information...
openelectron committed Apr 7, 2016
1 parent 46facc3 commit 0e14a20cbfffbf36e4eac611647dc4d58ffe6b7f
Showing with 10 additions and 2 deletions.
  1. +2 −0 config.py.EXAMPLE
  2. +8 −2 lib/oven.py
@@ -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

@@ -146,11 +146,17 @@ def set_heat(self, value):
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:

0 comments on commit 0e14a20

Please sign in to comment.