1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

fix tmp102 negative calculation (#6320)

This commit is contained in:
Samuel Sieb
2024-03-03 23:33:39 -08:00
committed by GitHub
parent bc74dd4980
commit 56837b0947

View File

@@ -39,9 +39,6 @@ void TMP102Component::update() {
return;
}
raw_temperature = i2c::i2ctohs(raw_temperature);
if (raw_temperature & 0x8000) {
raw_temperature |= 0xF000;
}
raw_temperature = raw_temperature >> 4;
float temperature = raw_temperature * TMP102_CONVERSION_FACTOR;
ESP_LOGD(TAG, "Got Temperature=%.1f°C", temperature);