fix sen5x negative temperature (#6082)

This commit is contained in:
Samuel Sieb 2024-01-12 01:11:42 -08:00 committed by Keith Burzinski
parent 1821ddd996
commit a6f864a4a3
No known key found for this signature in database
GPG key ID: 802564C5F0EEFFBE

View file

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