def onclock_read_data(self): #print "clock_read_data "+str(datetime.datetime.now().strftime("%H:%S")) try: #temperature, humidity in if meteo_gpio.readTemperatureIN(): self.builder.get_object("temperature_in_label").set_text(str(meteo_gpio.temperature1)+ " °C") self.builder.get_object("humidity_in_label").set_text(str(meteo_gpio.humidity1)+ " %") else: self.addRecord("Teplota, vlhkost vnitřní - neúspěšné měření", True) #temperature out if meteo_gpio.readTemperatureOUT(): self.builder.get_object("temperature_out_label").set_text(str(meteo_gpio.temperature2)+ " °C") else: self.addRecord("Teplota venkovní - neúspěšné měření", True) #humidity out if meteo_gpio.readHumidityOUT(): self.builder.get_object("humidity_out_label").set_text(str(meteo_gpio.humidity2)+ " %") else: self.addRecord("Vlhkost - neúspěšné měření", True) #light if meteo_gpio.readLight(): self.builder.get_object("label42").set_text(str(meteo_gpio.light)+ " lx") self.builder.get_object("levelbar1").set_value(float(meteo_gpio.light)/2000) else: self.addRecord("Teplota - neúspěšné měření", True) #info self.builder.get_object("label10").set_text(str(datetime.datetime.now().strftime("%H:%M:%S"))) self.addRecord('Údaje senzorů aktualizovány') finally: return True
def clock_read_data(self): #print "clock_read_data "+str(datetime.datetime.now().strftime("%H:%S")) try: #temperature meteo_gpio.readTemperature() self.builder.get_object("label9").set_text(str(meteo_gpio.temperature)+ " °C") #humidity meteo_gpio.readHumidity() self.builder.get_object("label8").set_text(str(meteo_gpio.humidity)+ " %") #light meteo_gpio.readLight() self.builder.get_object("label42").set_text(str(meteo_gpio.light)+ " lx") self.builder.get_object("levelbar1").set_value(float(meteo_gpio.light)/1000) #info self.builder.get_object("label10").set_text(str(datetime.datetime.now().strftime("%H:%M:%S"))) finally: return True
def onclock_read_data(self): #print "clock_read_data "+str(datetime.datetime.now().strftime("%H:%S")) try: #TEMP, HUM IN if meteo_gpio.readTemperatureIN(): self.builder.get_object("temperature_in_label").set_text(str(meteo_gpio.temperature1)+ " °C") self.builder.get_object("humidity_in_label").set_text(str(meteo_gpio.humidity1)+ " %") else: self.addRecord("DHT11 - neúspěšné měření VNITRNI TEPLOTY A VLHKOSTI", True) #TEMP-OUT if meteo_gpio.readTemperatureOUT(): self.builder.get_object("temperature_out_label").set_text(str(meteo_gpio.temperature2)+ " °C") else: self.addRecord("DS18 - neúspěšné měření VENKOVNI TEPLOTY ", True) #HUM-OUT,DHT22 if meteo_gpio.readHumidityOUT(): self.builder.get_object("humidity_out_label").set_text(str(meteo_gpio.humidity2)+ " %") else: self.addRecord("DHT22 - neúspěšné měřeni VENKOVNI VLHKOSTI", True) #ESP if meteo_gpio.readEsp(): self.builder.get_object("temperature_esp_label").set_text(str(meteo_gpio.teplotaEsp)+ " °C") else: self.addRecord("Esp - neodpovida", True) #BAROMETER #TLAK if meteo_gpio.readPress(): self.builder.get_object("press_label").set_text(str(meteo_gpio.pressure)+ " Pa") else: self.addRecord("BMP - neúspěšné měření tlaku", True) #VYSKA if meteo_gpio.readAltitude(): self.builder.get_object("altitude_label").set_text(str(meteo_gpio.altitude)+ m") else: self.addRecord("BMP - neuspesne zmerena vyska", True) #LIGHT if meteo_gpio.readLight(): self.builder.get_object("label42").set_text(str(meteo_gpio.light)+ " lx") self.builder.get_object("levelbar1").set_value(float(meteo_gpio.light)/2000) else: self.addRecord("Světlo - neúspěšné měření", True) #info self.builder.get_object("label10").set_text(str(datetime.datetime.now().strftime("%H:%M:%S"))) self.addRecord('Údaje senzorů aktualizovány') finally: return True