diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 6d4c9c1c7..23bd31fef 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -55,6 +55,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c ### Version 8.2.0.3 - Change HM-10 sensor type detection and add features (#7962) +- Change light scheme 2,3,4 cycle time speed from 24,48,72,... seconds to 4,6,12,24,36,48,... seconds (#8034) - Fix possible Relay toggle on (OTA) restart - Fix Zigbee sending wrong Sat value with Hue emulation - Add Zigbee command ``ZbRestore`` to restore device configuration dumped with ``ZbStatus 2`` diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 59985d6fc..bfd407b22 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -2,6 +2,7 @@ ### 8.2.0.3 20200329 +- Change light scheme 2,3,4 cycle time speed from 24,48,72,... seconds to 4,6,12,24,36,48,... seconds (#8034) - Add support for longer template names - Add Zigbee command ``ZbBindState`` and ``manuf``attribute - Add commands ``CounterDebounceLow`` and ``CounterDebounceHigh`` to control debouncing (#8021) diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index 6b72da9b2..174ef74a9 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -1612,8 +1612,9 @@ void LightPreparePower(power_t channels = 0xFFFFFFFF) { // 1 = only RGB, 2 = void LightCycleColor(int8_t direction) { - if (Light.strip_timer_counter % (Settings.light_speed * 2)) { - return; + if (Settings.light_speed > 3) { +// if (Light.strip_timer_counter % (Settings.light_speed * 2)) { return; } + if (Light.strip_timer_counter % (Settings.light_speed - 2)) { return; } // Speed 4: 24sec, 5: 36sec, 6: 48sec, etc } if (0 == direction) { @@ -1630,7 +1631,11 @@ void LightCycleColor(int8_t direction) // direction = (Light.random < Light.wheel) ? -1 : 1; direction = (Light.random &0x01) ? 1 : -1; } + + if (Settings.light_speed < 3) { direction *= (4 - Settings.light_speed); } // Speed 1: 12/3=4sec, 2: 12/2=6sec, 3: 12sec +// if (Settings.light_speed < 3) { direction <<= (3 - Settings.light_speed); } // Speed 1: 12/4=3sec, 2: 12/2=6sec, 3: 12sec Light.wheel += direction; + uint16_t hue = changeUIntScale(Light.wheel, 0, 255, 0, 359); // Scale to hue to keep amount of steps low (max 255 instead of 359) // AddLog_P2(LOG_LEVEL_DEBUG, PSTR("LGT: random %d, wheel %d, hue %d"), Light.random, Light.wheel, hue);