If the author ever comes back, I’ve made a couple of changes to the module that I’d love to see applied.
Floating point trouble, (both temperature and humidity values are coming up as “xx.xxx9999999999”)
I have a DHT22, but it did this with the DHT11 too, before I burned it up trying to move it from one board to another.
This gives you the tens and rounds off the rest.
// Convert C to F
if (this.config.units === "imperial") {
this.temperature = Math.round((data.temperature * 9/5 + 32)*10)/10;
} else {
this.temperature = data.temperature;
}
if (typeof this.temperature !== "undefined" && this.temperature !== null) {
this.sendNotification("INDOOR_TEMPERATURE", this.temperature);
}
this.humidity = Math.round(data.humidity*10)/10;
if (typeof this.humidity !== "undefined" && this.humidity !== null) {
this.sendNotification("INDOOR_HUMIDITY", this.humidity);
}
this.updateDom(this.config.animationSpeed);
}