mirror of
https://gitee.com/qpy-solutions/tracker-v2.git
synced 2025-05-19 19:18:25 +08:00
update: tempreature and humidity check and get
This commit is contained in:
parent
873d898ade
commit
5dca1ab0f3
@ -305,6 +305,7 @@ class Collector(Singleton):
|
|||||||
|
|
||||||
def __get_temp_humidity(self):
|
def __get_temp_humidity(self):
|
||||||
data = {}
|
data = {}
|
||||||
|
if self.__temp_humidity_sensor is not None:
|
||||||
on_res = self.__temp_humidity_sensor.on()
|
on_res = self.__temp_humidity_sensor.on()
|
||||||
if on_res:
|
if on_res:
|
||||||
temperature, humidity = self.__temp_humidity_sensor.read()
|
temperature, humidity = self.__temp_humidity_sensor.read()
|
||||||
|
@ -90,6 +90,9 @@ class DeviceCheck(object):
|
|||||||
def temp(self):
|
def temp(self):
|
||||||
# return True if OK
|
# return True if OK
|
||||||
res = False
|
res = False
|
||||||
|
if self.__temp_humidity is None:
|
||||||
|
res = None
|
||||||
|
else:
|
||||||
if self.__temp_humidity.on():
|
if self.__temp_humidity.on():
|
||||||
temperature, humidity = self.__temp_humidity.read()
|
temperature, humidity = self.__temp_humidity.read()
|
||||||
if temperature is not None and humidity is not None:
|
if temperature is not None and humidity is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user