diff --git a/sonoff/settings.h b/sonoff/settings.h index 8af704831..11e200a99 100644 --- a/sonoff/settings.h +++ b/sonoff/settings.h @@ -82,7 +82,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t tuya_dimmer_range_255 : 1; // bit 16 (v6.6.0.1) - SetOption66 - Enable or Disable Dimmer range 255 slider control uint32_t buzzer_enable : 1; // bit 17 (v6.6.0.1) - SetOption67 - Enable buzzer when available uint32_t pwm_multi_channels : 1; // bit 18 (v6.6.0.3) - SetOption68 - Enable multi-channels PWM instead of Color PWM - uint32_t spare19 : 1; + uint32_t tuya_dimmer_min_limit : 1; // bit 19 (v6.6.0.5) - SetOption69 - Limits Tuya dimmers to minimum of 10% (25) when enabled. uint32_t spare20 : 1; uint32_t spare21 : 1; uint32_t spare22 : 1; diff --git a/sonoff/xdrv_16_tuyadimmer.ino b/sonoff/xdrv_16_tuyadimmer.ino index 362d85a3a..a1d3ec91f 100644 --- a/sonoff/xdrv_16_tuyadimmer.ino +++ b/sonoff/xdrv_16_tuyadimmer.ino @@ -143,7 +143,9 @@ bool TuyaSetChannels(void) void LightSerialDuty(uint8_t duty) { if (duty > 0 && !tuya_ignore_dim && TuyaSerial) { - if (duty < 25) { duty = 25; } // dimming acts odd below 25(10%) - this mirrors the threshold set on the faceplate itself + if (Settings.flag3.tuya_dimmer_min_limit) { // Enable dimming limit SetOption69: Enabled by default + if (duty < 25) { duty = 25; } // dimming acts odd below 25(10%) - this mirrors the threshold set on the faceplate itself + } if (Settings.flag3.tuya_show_dimmer == 0) { if(Settings.flag3.tuya_dimmer_range_255 == 0) {