fix: negative temperatures on PMS5003T sensors (#6100)

This commit is contained in:
aschmitz 2024-01-15 01:08:19 -06:00 committed by GitHub
parent 412c999f14
commit 87cab92af6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -279,7 +279,7 @@ void PMSX003Component::parse_data_() {
// Note the pm particles 50um & 100um are not returned,
// as PMS5003T uses those data values for temperature and humidity.
float temperature = this->get_16_bit_uint_(24) / 10.0f;
float temperature = (int16_t) this->get_16_bit_uint_(24) / 10.0f;
float humidity = this->get_16_bit_uint_(26) / 10.0f;
ESP_LOGD(TAG,