Usage of default values if no gpio in config

This commit is contained in:
Dirk Alders 2020-09-06 13:25:58 +02:00
parent 09a849903c
commit fd86c70c83

View File

@ -1,4 +1,8 @@
from config import dht_gpio
try:
from config import dht_gpio
except ImportError:
dht_gpio = None
try:
import Adafruit_DHT as dht
except ImportError:
@ -25,7 +29,7 @@ class EnvSens(object):
#
# DHT22
#
if dht is None:
if dht is None or dht_gpio is None:
h = -17.3
t = -125.7
else: