From 18bc158bc84ca2d3c7c713e106dabf8329fa0920 Mon Sep 17 00:00:00 2001 From: Hadinger Date: Fri, 20 Dec 2019 16:01:24 +0100 Subject: [PATCH 1/2] Fix Fade would ignore ``savedata 0`` and store to flash anyways (#7262) --- tasmota/CHANGELOG.md | 1 + tasmota/xdrv_04_light.ino | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 2b32857c2..f14c46658 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -10,6 +10,7 @@ - Add fallback support from version 8.x - Add restriction if fallback firmware is incompatible with settings resulting in unreachable device - Add support for DHT12 Temperature and Humidity sensor by Stefan Oskamp +- Fix Fade would ignore ``savedata 0`` and store to flash anyways (#7262) ### 7.1.2.5 20191213 diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index 7f1e66fc6..6148a9aad 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -1766,11 +1766,13 @@ void LightApplyFade(void) { // Note: Settings.light_speed is the number of half-seconds for a 100% fade, // i.e. light_speed=1 means 1024 steps in 10 ticks (500ms) Light.fade_duration = (distance * Settings.light_speed * 10) / 1024; - // Also postpone the save_data for the duration of the Fade (in seconds) - uint32_t delay_seconds = 1 + (Light.fade_duration + 19) / 20; // add one more second - // AddLog_P2(LOG_LEVEL_INFO, PSTR("delay_seconds %d, save_data_counter %d"), delay_seconds, save_data_counter); - if (save_data_counter < delay_seconds) { - save_data_counter = delay_seconds; // pospone + if (Settings.save_data) { + // Also postpone the save_data for the duration of the Fade (in seconds) + uint32_t delay_seconds = 1 + (Light.fade_duration + 19) / 20; // add one more second + // AddLog_P2(LOG_LEVEL_INFO, PSTR("delay_seconds %d, save_data_counter %d"), delay_seconds, save_data_counter); + if (save_data_counter < delay_seconds) { + save_data_counter = delay_seconds; // pospone + } } } else { // no fade needed, we keep the duration at zero, it will fallback directly to end of fade From 70a2c2cd20cb5a6003151f1cdf05a9232bd7a1da Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 20 Dec 2019 16:22:49 +0100 Subject: [PATCH 2/2] Fix Fade --- RELEASENOTES.md | 3 +++ tasmota/CHANGELOG.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 234258dab..56c4e2c07 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -14,6 +14,8 @@ See [migration path](https://tasmota.github.io/docs/#/Upgrading?id=migration-pat 4. Migrate to **Sonoff-Tasmota 6.x** 5. Migrate to **Tasmota 7.x** +Only this version will support fallback from version 8.x. + ## Supported Core versions This release will be supported from ESP8266/Arduino library Core version **2.6.1** due to reported security and stability issues on previous Core version. @@ -59,6 +61,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Fix duplicated ``Backlog`` when using Event inside a Backlog by Adrian Scillato (#7178, #7147) - Fix Gui Timer when using a negative zero offset of -00:00 by Peter Ooms (#7174) - Fix DeepSleep in case there is no wifi by Stefan Bode (#7213) +- Fix Fade would ignore ``savedata 0`` and store to flash anyways (#7262) - Add command ``SerialConfig 0..23`` or ``SerialConfig 8N1`` to select Serial Config based in PR by Luis Teixeira (#7108) - Add command ``Sensor34 9 `` to set minimum delta to trigger JSON message by @tobox (#7188) - Add rule var ``%topic%`` by Adrian Scillato (#5522) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index f14c46658..d847aef5b 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -5,12 +5,12 @@ - Change some more Settings locations freeing up space for future single char allowing variable length text - Change tasmota-basic.bin and FIRMWARE_BASIC to tasmota-lite.bin and FIRMWARE_LITE - Fix DeepSleep in case there is no wifi by Stefan Bode (#7213) +- Fix Fade would ignore ``savedata 0`` and store to flash anyways (#7262) - Add Zigbee send automatic ZigbeeRead after sending a command - Add Zigbee improving Occupancy:false detection for Aqara sensor - Add fallback support from version 8.x - Add restriction if fallback firmware is incompatible with settings resulting in unreachable device - Add support for DHT12 Temperature and Humidity sensor by Stefan Oskamp -- Fix Fade would ignore ``savedata 0`` and store to flash anyways (#7262) ### 7.1.2.5 20191213