From f9b0947d67788ea1b90ad82999869e279b5554bb Mon Sep 17 00:00:00 2001 From: Hristo Kapanakov Date: Fri, 21 Jan 2022 18:56:19 +0200 Subject: [PATCH] Set default IR receive tolerance (25%) if set to zero --- tasmota/xdrv_05_irremote.ino | 1 + tasmota/xdrv_05_irremote_full.ino | 1 + 2 files changed, 2 insertions(+) diff --git a/tasmota/xdrv_05_irremote.ino b/tasmota/xdrv_05_irremote.ino index 72147fa19..7983436d6 100644 --- a/tasmota/xdrv_05_irremote.ino +++ b/tasmota/xdrv_05_irremote.ino @@ -198,6 +198,7 @@ void IrReceiveUpdateThreshold(void) void IrReceiveUpdateTolerance(void) { if (irrecv != nullptr) { + if (Settings->param[P_IR_TOLERANCE] == 0) { Settings->param[P_IR_TOLERANCE] = IR_RCV_TOLERANCE; } if (Settings->param[P_IR_TOLERANCE] > 100) { Settings->param[P_IR_TOLERANCE] = 100; } irrecv->setTolerance(Settings->param[P_IR_TOLERANCE]); } diff --git a/tasmota/xdrv_05_irremote_full.ino b/tasmota/xdrv_05_irremote_full.ino index 9a9703b9f..aa85e82a0 100644 --- a/tasmota/xdrv_05_irremote_full.ino +++ b/tasmota/xdrv_05_irremote_full.ino @@ -196,6 +196,7 @@ void IrReceiveUpdateThreshold(void) void IrReceiveUpdateTolerance(void) { if (irrecv != nullptr) { + if (Settings->param[P_IR_TOLERANCE] == 0) { Settings->param[P_IR_TOLERANCE] = IR_RCV_TOLERANCE; } if (Settings->param[P_IR_TOLERANCE] > 100) { Settings->param[P_IR_TOLERANCE] = 100; } irrecv->setTolerance(Settings->param[P_IR_TOLERANCE]); }