diff --git a/code/espurna/config/sensors.h b/code/espurna/config/sensors.h index 6388a497..a8b00a84 100644 --- a/code/espurna/config/sensors.h +++ b/code/espurna/config/sensors.h @@ -36,9 +36,9 @@ #define DHT_UPDATE_INTERVAL 60000 #endif -#define DHT_TIMING 11 #define DHT_TEMPERATURE_TOPIC "temperature" #define DHT_HUMIDITY_TOPIC "humidity" +#define DHT_TEMPERATURE_DECIMALS 1 // Decimals for temperature values #define HUMIDITY_NORMAL 0 #define HUMIDITY_COMFORTABLE 1 diff --git a/code/espurna/dht.ino b/code/espurna/dht.ino index 4aaa9325..b7bc6610 100644 --- a/code/espurna/dht.ino +++ b/code/espurna/dht.ino @@ -136,7 +136,8 @@ int readDHT() { // ----------------------------------------------------------------------------- double getDHTTemperature(bool celsius) { - return celsius ? _dhtTemperature : _dhtTemperature * 1.8 + 32; + double value = celsius ? _dhtTemperature : _dhtTemperature * 1.8 + 32; + return roundTo(value, DHT_TEMPERATURE_DECIMALS); } double getDHTTemperature() {