def get_humidity(): sensor = DHT(DHTpin) status = sensor.readDHT11() if status is sensor.DHTLIB_OK: return sensor.humidity else: return None
def get_temperature(): sensor = DHT(DHTpin) status = sensor.readDHT11() if status is sensor.DHTLIB_OK: return sensor.temperature else: return None
def get_temperature(): global current_temperature try: sensor = DHT(DHTpin) status = sensor.readDHT11() if status is sensor.DHTLIB_OK: current_temperature = sensor.temperature except Exception as e: print(e)
def get_temp(): dht = DHT(11) dht.readDHT11 return (dht.temperature)