Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
emergency temp handling
Browse files Browse the repository at this point in the history
  • Loading branch information
yaleman committed Jan 4, 2016
1 parent 91f90c4 commit e4bdcb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions coffeemachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

TEMP_UNITS = 'c'
TEMP_SETPOINT = 92.0
TEMP_EMERGENCY = 99.0

### HARDWARE SETTINGS ###
DEBUG = True
Expand Down Expand Up @@ -208,6 +209,10 @@ def tick(self):
if(time_since_last_tick > 0.5):
sys.exit("Program running too slow, scary things might happen")

# handle possible heater overrun
if( self.temp > TEMP_EMERGENCY ):
self.setpin(False, PIN_HEATER)

if(self.status['timeout'] == False):
# check to see if the machine's been on too long
if (self.current_time - self.status['last_power_on'] > MAX_TIME_ON):
Expand Down

0 comments on commit e4bdcb9

Please sign in to comment.