From 0cebf9a28fc0e5c7243e8650d0b29f65eab67908 Mon Sep 17 00:00:00 2001 From: Norbert Richter Date: Sat, 4 Jul 2020 10:43:02 +0200 Subject: [PATCH] Fix shutter target == 255 on close --- tasmota/xdrv_27_shutter.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/xdrv_27_shutter.ino b/tasmota/xdrv_27_shutter.ino index 4e0f02945..331678eb9 100644 --- a/tasmota/xdrv_27_shutter.ino +++ b/tasmota/xdrv_27_shutter.ino @@ -161,7 +161,7 @@ uint8_t ShutterRealToPercentPosition(int32_t realpos, uint32_t index) break; } } - return realpercent; + return (int16_t)realpercent < 0 ? 0 : realpercent; } }