Skip to content

Commit

Permalink
Fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtnorthcott committed Aug 21, 2016
1 parent fcde064 commit 120a936
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def set_red(self):
if self.is_red: return
self.reset_all()
self.is_red = True
thr = threading.Thread(target=self._red_subroutine, args=(conf.BUZZER_DURATION))
thr = threading.Thread(target=self._red_subroutine, args=(conf.TIME_BUZZER_DURATION, ))
thr.start()

def _red_subroutine(self, period):
Expand All @@ -91,7 +91,7 @@ def _red_subroutine(self, period):
GPIO.output(ID_BUZZER, OFF)

def buzz(self):
thr = threading.Thread(target=self._buzz, args=(conf.BUZZER_DURATION))
thr = threading.Thread(target=self._buzz, args=(conf.TIME_BUZZER_DURATION, ))
thr.start()

def _buzz(self, duration):
Expand All @@ -100,4 +100,4 @@ def _buzz(self, duration):
GPIO.output(ID_BUZZER, OFF)

def lcd_out(self, string, line, justify="left"):
self.lcd.string_out(string, line, justify)
self.lcd.string_out(string, line, justify)
6 changes: 2 additions & 4 deletions monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,15 @@ def update_values(self):
def temp_string(self):
temp = "{}C".format(self.temperature)
humidity = "{}%".format(self.humidity)
rainfall = "{}mm".format(self.wind_dir)
rainfall = "{}mm".format(self.rainfall)

return "{:<6} {:<4} {:>6}".format(temp, humidity, rainfall)

def wind_string(self):
gust = "{}km/h".format(self.wind_speed_gust)
mean = "{}km/h".format(self.wind_speed_mean)

return "{:<7} {:<7} {:>3}".format(gust, mean, self.wind_dir)
return "{:<7} {:<7} {:>3}".format(gust, mean, self.wind_dir)


class MonitorInterface(object):
Expand Down Expand Up @@ -194,5 +194,3 @@ def main():
main()
except KeyboardInterrupt:
pass
finally:
GPIO.cleanup()

0 comments on commit 120a936

Please sign in to comment.