mirror of https://github.com/arendst/Tasmota.git
Tuya Dimmer: Make dimmer lower limit optional.
Not all Tuya dimmers have a lower limit of 10% (25)
This commit is contained in:
parent
52ec4b93f3
commit
0235bc0f8c
|
@ -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;
|
||||
|
|
|
@ -890,6 +890,7 @@ void SettingsDefaultSet2(void)
|
|||
Settings.light_pixels = WS2812_LEDS;
|
||||
// Settings.light_rotation = 0;
|
||||
SettingsDefaultSet_5_8_1(); // Clock color
|
||||
Settings.flag3.tuya_dimmer_min_limit = 1;
|
||||
|
||||
// Display
|
||||
SettingsDefaultSet_5_10_1(); // Display settings
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue