Fix Sonoff L1 Lite MusicSync mode

Fix unable to disable MusicSync mode on Sonoff L1 Lite regression from 9.3.0 (#12930)
This commit is contained in:
Theo Arends 2021-08-25 15:24:55 +02:00
parent 4b5ba3971b
commit a6310780ee
3 changed files with 11 additions and 9 deletions

View File

@ -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 - 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) - Wiegand support for keypad zero key in single key mode using ``SetOption124 1`` (#12960)
- Hass and Tasmota discovery prefix topic notifications (#12972) - 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 ## [9.5.0.6] 20210820
### Added ### Added

View File

@ -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) - 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) - 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) - 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) - 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) - Hass and Tasmota discovery prefix topic notifications [#12972](https://github.com/arendst/Tasmota/issues/12972)

View File

@ -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; } 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; uint32_t mode = (Settings->sbflag1.sonoff_l1_music_sync) ? SONOFF_L1_MODE_SYNC_TO_MUSIC : SONOFF_L1_MODE_COLORFUL;
if (Settings->sbflag1.sonoff_l1_music_sync) { 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"),
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"),
LocalTime(), millis()%1000, LocalTime(), millis()%1000,
Snfl1.power ? "on" : "off", Snfl1.power ? "on" : "off",
Snfl1.color[0], Snfl1.color[1], Snfl1.color[2], Snfl1.color[0], Snfl1.color[1], Snfl1.color[2],
Snfl1.dimmer, Snfl1.dimmer,
mode, mode);
Snfl1.sensitive, if (SONOFF_L1_MODE_SYNC_TO_MUSIC == mode) {
Snfl1.speed); 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 #ifdef SONOFF_L1_START_DELAY
static bool first_call = true; static bool first_call = true;