From b7a18f7bcc4b2ea8e98f0476ba7a67cea5a06d9c Mon Sep 17 00:00:00 2001 From: Joel Stein Date: Mon, 26 Nov 2018 00:31:45 +0100 Subject: [PATCH] PS_16_DZ: tryfix dimming --- sonoff/xdrv_04_light.ino | 4 ++-- sonoff/xdrv_19_ps16dz_dimmer.ino | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sonoff/xdrv_04_light.ino b/sonoff/xdrv_04_light.ino index 455adc4d0..b4f10a148 100644 --- a/sonoff/xdrv_04_light.ino +++ b/sonoff/xdrv_04_light.ino @@ -832,7 +832,7 @@ void LightAnimate(void) LightMy92x1Duty(cur_col[0], cur_col[1], cur_col[2], cur_col[3], cur_col[4]); } #ifdef USE_TUYA_DIMMER - if (light_type == LT_SERIAL1) { + if (light_type == LT_SERIAL1 && Settings.module == TUYA_DIMMER ) { LightSerialDuty(cur_col[0]); } #endif // USE_TUYA_DIMMER @@ -842,7 +842,7 @@ void LightAnimate(void) } #endif // USE_ARMTRONIX_DIMMERS #ifdef USE_PS_16_DZ - if (light_type == LT_SERIAL1) { + if (light_type == LT_SERIAL1 && Settings.module == PS_16_DZ) { PS16DZSerialDuty(cur_col[0]); } #endif // USE_PS_16_DZ diff --git a/sonoff/xdrv_19_ps16dz_dimmer.ino b/sonoff/xdrv_19_ps16dz_dimmer.ino index 78e2f7cfb..f3f219d60 100644 --- a/sonoff/xdrv_19_ps16dz_dimmer.ino +++ b/sonoff/xdrv_19_ps16dz_dimmer.ino @@ -31,7 +31,8 @@ boolean ps16dz_ignore_dim = false; // Flag to skip serial send to pre boolean ps16dz_power = false; uint8_t ps16dz_bright = 0; -uint64_t ps16dz_seq = 1529000000000; +//uint64_t ps16dz_seq = 1529000000000; +uint64_t ps16dz_seq = 0; char ps16dz_tx_buffer[PS16DZ_BUFFER_SIZE]; // Serial transmit buffer char ps16dz_rx_buffer[PS16DZ_BUFFER_SIZE]; // Serial receive buffer