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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;