How to obtain the type of DHT sensor I made a simple temperature controller on DHT11.
I want it to work with DHT22 as well having the same code.

However, I can’t find a way how to get known what type of sensor is installed.
Is there a way?
You can use another library for DHT: https://github.com/markruys/arduino-DHT
Although, the library is quite old, it works fine and has auto-detection feature.