Usage of default values if no gpio in config
This commit is contained in:
parent
09a849903c
commit
fd86c70c83
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user