From b1371b63ccc59c19bf1df47e87c44436024eee7f Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 30 Apr 2021 11:59:08 +0200 Subject: [PATCH] Correction of Ds18x20Name() search Correction of Ds18x20Name() search (#11958) --- tasmota/xsns_05_ds18x20_esp32.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasmota/xsns_05_ds18x20_esp32.ino b/tasmota/xsns_05_ds18x20_esp32.ino index 2f929dab7..4c501dde7 100644 --- a/tasmota/xsns_05_ds18x20_esp32.ino +++ b/tasmota/xsns_05_ds18x20_esp32.ino @@ -156,11 +156,10 @@ bool Ds18x20Read(uint8_t sensor, float &t) { void Ds18x20Name(uint8_t sensor) { uint8_t index = sizeof(ds18x20_chipids); - while (index) { + while (--index) { if (ds18x20_sensor[ds18x20_sensor[sensor].index].address[0] == ds18x20_chipids[index]) { break; } - index--; } GetTextIndexed(DS18X20Data.name, sizeof(DS18X20Data.name), index, kDs18x20Types); if (DS18X20Data.sensors > 1) {