from time import sleep_ms, localtime
from dht import DHT22
from machine import Pin
sensor= DHT22(Pin(27))
rtc = localtime()
timestamp = (f' {rtc[0]}-{rtc[1]}-{rtc[2]}T{rtc[3]}:{rtc[4]}:{rtc[5]}')
while True:
sensor.measure()
sensor.temperature()
sensor.humidity()
print (sensor.temperature)