1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

fix sen5x negative temperature (#6082)

This commit is contained in:
Samuel Sieb
2024-01-12 01:11:42 -08:00
committed by GitHub
parent 4cc17dac0d
commit 343a8c063e

View File

@@ -352,7 +352,7 @@ void SEN5XComponent::update() {
float humidity = measurements[4] / 100.0;
if (measurements[4] == 0xFFFF)
humidity = NAN;
float temperature = measurements[5] / 200.0;
float temperature = (int16_t) measurements[5] / 200.0;
if (measurements[5] == 0xFFFF)
temperature = NAN;
float voc = measurements[6] / 10.0;