Skip to content

Commit

Permalink
Change light scheme 2,3,4 cycle time
Browse files Browse the repository at this point in the history
Change light scheme 2,3,4 cycle time speed from 24,48,72,... seconds to 4,6,12,24,36,48,... seconds (#8034)
  • Loading branch information
arendst committed Mar 31, 2020
1 parent 7ebb5f3 commit 39d8011
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
1 change: 1 addition & 0 deletions tasmota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 7 additions & 2 deletions tasmota/xdrv_04_light.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 39d8011

Please sign in to comment.