Add Sonoff L1 MusicSync off when a color change is requested

Add Sonoff L1 MusicSync off when a color change is requested (#12930)
This commit is contained in:
Theo Arends 2021-08-27 16:39:18 +02:00
parent bbe9f8f4ef
commit cf2891f9b9
1 changed files with 11 additions and 1 deletions

View File

@ -286,6 +286,16 @@ bool SnfL1SetChannels(void) {
return true;
}
bool SnfL1SetChannelsFromFunc(void) {
static bool first_call = true;
if (first_call) {
first_call = false; // Allow MusicSync at init time
} else {
Settings->sbflag1.sonoff_l1_music_sync = 0; // Disable MusicSync on user color change
}
return SnfL1SetChannels();
}
bool SnfL1ModuleSelected(void) {
if (SONOFF_L1 == TasmotaGlobal.module_type) {
if (PinUsed(GPIO_RXD) && PinUsed(GPIO_TXD)) {
@ -345,7 +355,7 @@ bool Xlgt05(uint8_t function)
result = SnfL1SerialInput();
break;
case FUNC_SET_CHANNELS:
result = SnfL1SetChannels();
result = SnfL1SetChannelsFromFunc();
break;
case FUNC_MODULE_INIT:
result = SnfL1ModuleSelected();