Change LM75AD output when no valid reading received from 0 to null (#24263)

This commit is contained in:
Theo Arends 2026-01-03 14:13:17 +01:00
parent 229d8fbb24
commit 971ddc72e8
3 changed files with 12 additions and 8 deletions

View File

@ -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) - 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) - 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) - Refactor Adafruit Seesaw soil driver (#24270)
- LM75AD output when no valid reading received from 0 to null (#24263)
### Fixed ### Fixed
- ESP32 BLE not starting (#24240) - ESP32 BLE not starting (#24240)

View File

@ -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) - 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) - 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) - 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) - Update Zigbee WebUI [#24224](https://github.com/arendst/Tasmota/issues/24224)
### Fixed ### Fixed

View File

@ -68,16 +68,18 @@ void LM75ADDetect(void) {
} }
float LM75ADGetTemp(void) { float LM75ADGetTemp(void) {
uint16_t t;
if (I2cValidRead16(&t, lm75ad_address, LM75_TEMP_REGISTER, lm75ad_bus)) {
int16_t sign = 1; int16_t sign = 1;
if (t & 0x8000) { // We are getting a negative temperature value
uint16_t t = I2cRead16(lm75ad_address, LM75_TEMP_REGISTER, lm75ad_bus);
if (t & 0x8000) { // we are getting a negative temperature value
t = (~t) +0x20; t = (~t) +0x20;
sign = -1; sign = -1;
} }
t = t >> 5; // shift value into place (5 LSB not used) t = t >> 5; // Shift value into place (5 LSB not used)
return ConvertTemp(sign * t * 0.125f); return ConvertTemp(sign * t * 0.125f);
} }
return NAN; // Will be changed to "null" by ext_vsprintf_P()
}
void LM75ADShow(bool json) { void LM75ADShow(bool json) {
float t = LM75ADGetTemp(); float t = LM75ADGetTemp();