def main(): try: lcd = LCD() lcd.blight(0) except Exception, e: print e lcd._clean_up() quit()
def main(): try: lcd = LCD() lcd.send_text(get_home_conditions(), 1) lcd.send_text(get_weather(), 2) # sleep(30) # lcd.send_text(get_buses(), 2) # sleep(30) except Exception, e: print e lcd._clean_up() quit()
def cron_lcd(): hum, temp = get_hum_and_temp() time = datetime.now().strftime('%H:%M') weather_dict = weather.get_weather() line1 = "{0:0.1f} C and {1:0.1f}%".format(temp, hum) line2 = time + " Feels %d" % (int(weather_dict['feels_like'])) try: lcd = LCD() sleep(0.5) lcd.send_text(line1, 1) lcd.send_text(line2, 2) except Exception: lcd._clean_up() raise