def return_temperature(message, *something): pin = 22 # たまに前回の電圧情報?が残っているので2回計測 humidity, temperature = Adafruit_DHT.read_retury(Adafruit_DHT.DHT22, pin) time.sleep(0.5) humidity, temperature = Adafruit_DHT.read_retury(Adafruit_DHT.DHT22, pin) if (humidity >= 80) & (temperature >= 30): comment = '蒸し暑いですね' elif (humidity <= 30) & (temperature <= 15): comment = '肌寒く、乾燥してます' else: comment = '快適かも?' message.reply('\n温度:{}℃,\n室温:{}%\n{}'.format(round(tempurature, 1), round(humidity, 1), comment))