- fix: dont import PIGPIO if datalogging is dissabled

This commit is contained in:
Ulrich Knechtelsdorfer
2016-07-03 20:42:53 +02:00
parent 47343601c9
commit f10c5f0911

View File

@@ -7,6 +7,7 @@ import signal
import thread import thread
import logging import logging
import atexit import atexit
import settings
import os import os
# i2c io pins # i2c io pins
@@ -25,9 +26,10 @@ I2C_STOP = 3
I2C_SET_ADDR = 4 I2C_SET_ADDR = 4
I2C_READ = 6 I2C_READ = 6
try: if settings.settings.fridgeLogging:
try:
import pigpio import pigpio
except: except:
logging.fatal("PIGPIO library could not be loaded, install PIGPIO to read sensor data or disable data logging in the settings!") logging.fatal("PIGPIO library could not be loaded, install PIGPIO to read sensor data or disable data logging in the settings!")
exit() exit()