From a6310780ee665394edb5c9b570acef4155f1b6a8 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 25 Aug 2021 15:24:55 +0200 Subject: [PATCH] Fix Sonoff L1 Lite MusicSync mode Fix unable to disable MusicSync mode on Sonoff L1 Lite regression from 9.3.0 (#12930) --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/xlgt_05_sonoff_l1.ino | 18 +++++++++--------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d62165be9..2efdb2ef2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. - Shelly 2.5 negative power values on relay 1 regression from 9.5.0.5 - Wiegand support for keypad zero key in single key mode using ``SetOption124 1`` (#12960) - Hass and Tasmota discovery prefix topic notifications (#12972) +- Unable to disable MusicSync mode on Sonoff L1 Lite regression from 9.3.0 (#12930) ## [9.5.0.6] 20210820 ### Added diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0f236ebfd..13c750ec0 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -169,5 +169,6 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - Neopool communication error [#12813](https://github.com/arendst/Tasmota/issues/12813) - WDT reset on shutters with stepper motors during deceleration [#12849](https://github.com/arendst/Tasmota/issues/12849) - Negative power values for ADE7953 based devices like Shelly EM [#12874](https://github.com/arendst/Tasmota/issues/12874) +- Unable to disable MusicSync mode on Sonoff L1 Lite regression from 9.3.0 [#12930](https://github.com/arendst/Tasmota/issues/12930) - Wiegand support for keypad zero key in single key mode using ``SetOption124 1`` [#12960](https://github.com/arendst/Tasmota/issues/12960) - Hass and Tasmota discovery prefix topic notifications [#12972](https://github.com/arendst/Tasmota/issues/12972) diff --git a/tasmota/xlgt_05_sonoff_l1.ino b/tasmota/xlgt_05_sonoff_l1.ino index f120bbd79..299c054f0 100644 --- a/tasmota/xlgt_05_sonoff_l1.ino +++ b/tasmota/xlgt_05_sonoff_l1.ino @@ -250,19 +250,19 @@ bool SnfL1SetChannels(void) { } if (!power_changed && !dimmer_changed && !color_changed && (Snfl1.old_music_sync == Settings->sbflag1.sonoff_l1_music_sync)) { return true; } - uint32_t mode = SONOFF_L1_MODE_COLORFUL; - if (Settings->sbflag1.sonoff_l1_music_sync) { - mode = SONOFF_L1_MODE_SYNC_TO_MUSIC; - } - - snprintf_P(Snfl1.buffer, SONOFF_L1_BUFFER_SIZE, PSTR("AT+UPDATE=\"sequence\":\"%d%03d\",\"switch\":\"%s\",\"light_type\":1,\"colorR\":%d,\"colorG\":%d,\"colorB\":%d,\"bright\":%d,\"mode\":%d,\"sensitive\":%d,\"speed\":%d"), + uint32_t mode = (Settings->sbflag1.sonoff_l1_music_sync) ? SONOFF_L1_MODE_SYNC_TO_MUSIC : SONOFF_L1_MODE_COLORFUL; + snprintf_P(Snfl1.buffer, SONOFF_L1_BUFFER_SIZE, PSTR("AT+UPDATE=\"sequence\":\"%d%03d\",\"switch\":\"%s\",\"light_type\":1,\"colorR\":%d,\"colorG\":%d,\"colorB\":%d,\"bright\":%d,\"mode\":%d"), LocalTime(), millis()%1000, Snfl1.power ? "on" : "off", Snfl1.color[0], Snfl1.color[1], Snfl1.color[2], Snfl1.dimmer, - mode, - Snfl1.sensitive, - Snfl1.speed); + mode); + if (SONOFF_L1_MODE_SYNC_TO_MUSIC == mode) { + snprintf_P(Snfl1.buffer, SONOFF_L1_BUFFER_SIZE, PSTR("%s,\"sensitive\":%d,\"speed\":%d"), + Snfl1.buffer, + Snfl1.sensitive, + Snfl1.speed); + } #ifdef SONOFF_L1_START_DELAY static bool first_call = true;