DHT sensor code improvement for testability