import Adafruit_DHT
import datetime
import json


def readdhtsensor(pinNumber):
    sensor = Adafruit_DHT.DHT22
    humidity, temperature = Adafruit_DHT.read_retry(sensor, pinNumber)
    # date_string = f'{datetime.datetime.now():%Y-%m-%d %H:%M:%S%z}'
    return json.dumps({"humidity": humidity, "temperature": temperature, "time": str(datetime.datetime.now())})

2e5fb57633b83df9585dd69c9d02be0a5b0f5e7b
<mask token>

<mask token>


def readdhtsensor(pinNumber):
    sensor = Adafruit_DHT.DHT22
    humidity, temperature = Adafruit_DHT.read_retry(sensor, pinNumber)
    return json.dumps({'humidity': humidity, 'temperature': temperature,
        'time': str(datetime.datetime.now())})

import Adafruit_DHT
import datetime
import json


def readdhtsensor(pinNumber):
    sensor = Adafruit_DHT.DHT22
    humidity, temperature = Adafruit_DHT.read_retry(sensor, pinNumber)
    return json.dumps({'humidity': humidity, 'temperature': temperature,
        'time': str(datetime.datetime.now())})

import Adafruit_DHT
import datetime
import json


def readdhtsensor(pinNumber):
    sensor = Adafruit_DHT.DHT22
    humidity, temperature = Adafruit_DHT.read_retry(sensor, pinNumber)
    # date_string = f'{datetime.datetime.now():%Y-%m-%d %H:%M:%S%z}'
    return json.dumps({"humidity": humidity, "temperature": temperature, "time": str(datetime.datetime.now())})
