diff --git a/CHANGELOG.md b/CHANGELOG.md index ac19ded23..c3dfa6cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. - ESP8266 platform update from 2025.10.00 to 2025.12.00 (#24254) - ESP32 Platform from 2025.12.30 to 2025.12.31, Framework (Arduino Core) from v3.1.7 to v3.1.8 and IDF from v5.3.4.251205 to v5.3.4.251223 (#24254) - Refactor Adafruit Seesaw soil driver (#24270) +- LM75AD output when no valid reading received from 0 to null (#24263) ### Fixed - ESP32 BLE not starting (#24240) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index a39c63cbe..ed29c0b03 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -123,6 +123,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Vid6608 library from v1.0.2 to v1.0.3 [#24218](https://github.com/arendst/Tasmota/issues/24218) - IRremoteESP8266 library from v2.8.6 to v2.8.6-ca474a6 [#24226](https://github.com/arendst/Tasmota/issues/24226) - Refactor Adafruit Seesaw soil driver [#24270](https://github.com/arendst/Tasmota/issues/24270) +- LM75AD output when no valid reading received from 0 to null [#24263](https://github.com/arendst/Tasmota/issues/24263) - Update Zigbee WebUI [#24224](https://github.com/arendst/Tasmota/issues/24224) ### Fixed diff --git a/tasmota/tasmota_xsns_sensor/xsns_26_lm75ad.ino b/tasmota/tasmota_xsns_sensor/xsns_26_lm75ad.ino index 502deb515..f700463c3 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_26_lm75ad.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_26_lm75ad.ino @@ -68,15 +68,17 @@ void LM75ADDetect(void) { } float LM75ADGetTemp(void) { - int16_t sign = 1; - - uint16_t t = I2cRead16(lm75ad_address, LM75_TEMP_REGISTER, lm75ad_bus); - if (t & 0x8000) { // we are getting a negative temperature value - t = (~t) +0x20; - sign = -1; + uint16_t t; + if (I2cValidRead16(&t, lm75ad_address, LM75_TEMP_REGISTER, lm75ad_bus)) { + int16_t sign = 1; + if (t & 0x8000) { // We are getting a negative temperature value + t = (~t) +0x20; + sign = -1; + } + t = t >> 5; // Shift value into place (5 LSB not used) + return ConvertTemp(sign * t * 0.125f); } - t = t >> 5; // shift value into place (5 LSB not used) - return ConvertTemp(sign * t * 0.125f); + return NAN; // Will be changed to "null" by ext_vsprintf_P() } void LM75ADShow(bool json) {