From f6c306489023d5fb24366c1ca336d2553edf4772 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 3 Aug 2024 18:03:41 +0200 Subject: [PATCH] Fix ADC migration --- tasmota/tasmota_xsns_sensor/xsns_02_analog.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_02_analog.ino b/tasmota/tasmota_xsns_sensor/xsns_02_analog.ino index 59bca008c..75b43b2c2 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_02_analog.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_02_analog.ino @@ -226,7 +226,7 @@ bool AdcGetSettings(uint32_t channel) { Adc[channel].param2 = atoi(subStr(parameters, SettingsText(SET_ADC_PARAM1 + channel), ",", 3)); Adc[channel].param3 = atoi(subStr(parameters, SettingsText(SET_ADC_PARAM1 + channel), ",", 4)); Adc[channel].param4 = atoi(subStr(parameters, SettingsText(SET_ADC_PARAM1 + channel), ",", 5)); - if (adc_type < GPIO_ADC_INPUT) { // Former ADC_END + if ((adc_type > 0) && (adc_type < GPIO_ADC_INPUT)) { // Former ADC_END AdcSaveSettings(channel); adc_type = AdcType(channel); // Migrate for backwards compatibility }