Rename enum LT_SERIALx

This commit is contained in:
Theo Arends 2025-12-01 14:10:05 +01:00
parent 4bda3e1b07
commit 91e501b3d6
10 changed files with 25 additions and 25 deletions

View File

@ -430,7 +430,7 @@ enum Ws2812Color { WS_RED, WS_GREEN, WS_BLUE };
enum LightSubtypes { LST_NONE, LST_SINGLE, LST_COLDWARM, LST_RGB, LST_RGBW, LST_RGBCW, LST_MAX=5 }; // Do not insert new fields
enum LightTypes { LT_BASIC, LT_PWM1, LT_PWM2, LT_PWM3, LT_PWM4, LT_PWM5, LT_PWM6, LT_PWM7,
LT_NU8, LT_SERIAL1, LT_SERIAL2, LT_RGB, LT_RGBW, LT_RGBWC, LT_NU14, LT_NU15 }; // Do not insert new fields
LT_NU8, LT_W, LT_CW, LT_RGB, LT_RGBW, LT_RGBWC, LT_NU14, LT_NU15 }; // Do not insert new fields
enum XsnsFunctions { FUNC_SETTINGS_OVERRIDE, FUNC_SETUP_RING1, FUNC_SETUP_RING2, FUNC_PRE_INIT, FUNC_INIT, FUNC_ACTIVE, FUNC_ABOUT_TO_RESTART,
FUNC_LOOP, FUNC_SLEEP_LOOP, FUNC_EVERY_50_MSECOND, FUNC_EVERY_100_MSECOND, FUNC_EVERY_200_MSECOND, FUNC_EVERY_250_MSECOND, FUNC_EVERY_SECOND,

View File

@ -32,8 +32,8 @@
* 6 PWM6
* 7 PWM7
* 8 reserved
* 9 SERIAL1 no
* 10 SERIAL2 yes
* 9 Serial1 W no
* 10 Serial2 CW yes
* 11 +WS2812 RGB no (One WS2812 RGB or RGBW ledstrip)
* 12 AiLight RGBW no
* 13 Sonoff B1 RGBCW yes

View File

@ -641,12 +641,12 @@ bool TuyaSetChannels(void)
uint8_t idx = 0;
snprintf_P(hex_char, sizeof(hex_char), PSTR("000000000000"));
if (LT_SERIAL1 == TasmotaGlobal.light_type) {
if (LT_W == TasmotaGlobal.light_type) {
Tuya.Snapshot[0] = light_state.getDimmer();
}
if (LT_SERIAL2 == TasmotaGlobal.light_type || LT_RGBWC == TasmotaGlobal.light_type) {
if (LT_CW == TasmotaGlobal.light_type || LT_RGBWC == TasmotaGlobal.light_type) {
idx = 1;
if (LT_SERIAL2 == TasmotaGlobal.light_type && Settings->flag3.pwm_multi_channels && (TuyaGetDpId(TUYA_MCU_FUNC_DIMMER2) != 0)) {
if (LT_CW == TasmotaGlobal.light_type && Settings->flag3.pwm_multi_channels && (TuyaGetDpId(TUYA_MCU_FUNC_DIMMER2) != 0)) {
// Special setup for dual dimmer (like the MOES 2 Way Dimmer) emulating 2 PWM channels
Tuya.Snapshot[0] = changeUIntScale(Light.current_color[0], 0, 255, 0, 100);
Tuya.Snapshot[1] = changeUIntScale(Light.current_color[1], 0, 255, 0, 100);
@ -1227,9 +1227,9 @@ bool TuyaModuleSelected(void) {
// Possible combinations for Lights:
// 0: NONE = LT_BASIC
// 1: DIMMER = LT_SERIAL1 - Common one channel dimmer
// 2: DIMMER, DIMMER2 = LT_SERIAL2 - Two channels dimmer (special setup used with SetOption68)
// 3: DIMMER, CT = LT_SERIAL2 - Dimmable light and White Color Temperature
// 1: DIMMER = LT_W - Common one channel dimmer
// 2: DIMMER, DIMMER2 = LT_CW - Two channels dimmer (special setup used with SetOption68)
// 3: DIMMER, CT = LT_CW - Dimmable light and White Color Temperature
// 4: DIMMER, RGB = LT_RGB - RGB Light
// 5: DIMMER, RGB, CT = LT_RGBWC - RGB LIght and White Color Temperature
// 6: DIMMER, RGB, WHITE = LT_RGBW - RGB LIght and White
@ -1244,8 +1244,8 @@ bool TuyaModuleSelected(void) {
} else if (TuyaGetDpId(TUYA_MCU_FUNC_CT) != 0 || TuyaGetDpId(TUYA_MCU_FUNC_DIMMER2) != 0) {
if (TuyaGetDpId(TUYA_MCU_FUNC_RGB) != 0) {
TasmotaGlobal.light_type = LT_RGBWC;
} else { TasmotaGlobal.light_type = LT_SERIAL2; }
} else { TasmotaGlobal.light_type = LT_SERIAL1; }
} else { TasmotaGlobal.light_type = LT_CW; }
} else { TasmotaGlobal.light_type = LT_W; }
} else {
TasmotaGlobal.light_type = LT_BASIC;
}

View File

@ -1272,13 +1272,13 @@ bool TuyaSetChannels(void)
uint8_t idx = 0;
snprintf_P(hex_char, sizeof(hex_char), PSTR("000000000000"));
if (LT_SERIAL1 == TasmotaGlobal.light_type) {
if (LT_W == TasmotaGlobal.light_type) {
pTuya->Snapshot[0] = light_state.getDimmer();
}
if (LT_SERIAL2 == TasmotaGlobal.light_type || LT_RGBWC == TasmotaGlobal.light_type) {
if (LT_CW == TasmotaGlobal.light_type || LT_RGBWC == TasmotaGlobal.light_type) {
idx = 1;
if (LT_SERIAL2 == TasmotaGlobal.light_type &&
if (LT_CW == TasmotaGlobal.light_type &&
Settings->flag3.pwm_multi_channels &&
(TuyaGetDpId(TUYA_MCU_FUNC_DIMMER2) != 0)) {
// Special setup for dual dimmer (like the MOES 2 Way Dimmer) emulating 2 PWM channels
@ -1978,9 +1978,9 @@ bool TuyaModuleSelected(void) {
// Possible combinations for Lights:
// 0: NONE = LT_BASIC
// 1: DIMMER = LT_SERIAL1 - Common one channel dimmer
// 2: DIMMER, DIMMER2 = LT_SERIAL2 - Two channels dimmer (special setup used with SetOption68)
// 3: DIMMER, CT = LT_SERIAL2 - Dimmable light and White Color Temperature
// 1: DIMMER = LT_W - Common one channel dimmer
// 2: DIMMER, DIMMER2 = LT_CW - Two channels dimmer (special setup used with SetOption68)
// 3: DIMMER, CT = LT_CW - Dimmable light and White Color Temperature
// 4: DIMMER, RGB = LT_RGB - RGB Light
// 5: DIMMER, RGB, CT = LT_RGBWC - RGB LIght and White Color Temperature
// 6: DIMMER, RGB, WHITE = LT_RGBW - RGB LIght and White
@ -1995,8 +1995,8 @@ bool TuyaModuleSelected(void) {
} else if (TuyaGetDpId(TUYA_MCU_FUNC_CT) != 0 || TuyaGetDpId(TUYA_MCU_FUNC_DIMMER2) != 0) {
if (TuyaGetDpId(TUYA_MCU_FUNC_RGB) != 0) {
TasmotaGlobal.light_type = LT_RGBWC;
} else { TasmotaGlobal.light_type = LT_SERIAL2; }
} else { TasmotaGlobal.light_type = LT_SERIAL1; }
} else { TasmotaGlobal.light_type = LT_CW; }
} else { TasmotaGlobal.light_type = LT_W; }
} else {
TasmotaGlobal.light_type = LT_BASIC;
}

View File

@ -87,7 +87,7 @@ void ArmtronixRequestState(void)
bool ArmtronixModuleSelected(void)
{
UpdateDevicesPresent(1);
TasmotaGlobal.light_type = LT_SERIAL2;
TasmotaGlobal.light_type = LT_CW;
return true;
}

View File

@ -200,7 +200,7 @@ void PS16DZInit(void)
bool PS16DZModuleSelected(void)
{
UpdateDevicesPresent(1);
TasmotaGlobal.light_type = LT_SERIAL1;
TasmotaGlobal.light_type = LT_W;
return true;
}

View File

@ -355,7 +355,7 @@ bool ExsModuleSelected(void)
SetSeriallog(LOG_LEVEL_NONE);
UpdateDevicesPresent(2);
TasmotaGlobal.light_type = LT_SERIAL2;
TasmotaGlobal.light_type = LT_CW;
return true;
}

View File

@ -164,7 +164,7 @@ bool SonoffD1ModuleSelected(void)
SetSerial(9600, TS_SERIAL_8N1);
UpdateDevicesPresent(1);
TasmotaGlobal.light_type = LT_SERIAL1;
TasmotaGlobal.light_type = LT_W;
return true;
}

View File

@ -730,7 +730,7 @@ bool ShdSerialInput(void)
bool ShdModuleSelected(void) {
if (PinUsed(GPIO_SHELLY_DIMMER_BOOT0) && PinUsed(GPIO_SHELLY_DIMMER_RST_INV)) {
UpdateDevicesPresent(1);
TasmotaGlobal.light_type = LT_SERIAL1;
TasmotaGlobal.light_type = LT_W;
Shd.present = true;
}

View File

@ -965,7 +965,7 @@ bool DaliInit(uint32_t function) {
Settings->light_correction = 0; // Use Dali light correction
UpdateDevicesPresent(1);
TasmotaGlobal.light_type = LT_SERIAL1; // Single channel
TasmotaGlobal.light_type = LT_W; // Single channel
#ifdef DALI_LIGHT_COLOR_SUPPORT
Dali->target_rgbwaf = DaliQueryRGBWAF(DaliTarget2Address(Dali->Settings.target));
if (Dali->target_rgbwaf > 1) {