Skip to content

Commit

Permalink
fix tmp102 negative calculation (esphome#6320)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssieb authored Mar 4, 2024
1 parent bc74dd4 commit 56837b0
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions esphome/components/tmp102/tmp102.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 56837b0

Please sign in to comment.