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:
|
try:
|
||||||
import Adafruit_DHT as dht
|
import Adafruit_DHT as dht
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -25,7 +29,7 @@ class EnvSens(object):
|
|||||||
#
|
#
|
||||||
# DHT22
|
# DHT22
|
||||||
#
|
#
|
||||||
if dht is None:
|
if dht is None or dht_gpio is None:
|
||||||
h = -17.3
|
h = -17.3
|
||||||
t = -125.7
|
t = -125.7
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user