diff --git a/tasmota/xlgt_04_sm2135.ino b/tasmota/xlgt_04_sm2135.ino index dd766ab33..92d1d5059 100644 --- a/tasmota/xlgt_04_sm2135.ino +++ b/tasmota/xlgt_04_sm2135.ino @@ -182,21 +182,12 @@ void Sm2135ModuleSelected(void) Sm2135.clk = Pin(GPIO_SM2135_CLK); Sm2135.data = Pin(GPIO_SM2135_DAT, GPIO_ANY); - Sm2135.model = SM2135_WCGRB; + Sm2135.model = GetPin(Sm2135.data) - AGPIO(GPIO_SM2135_DAT); // 0 .. 3 if (PinUsed(GPIO_SWT1)) { Sm2135.model = SM2135_WCBGR; pinMode(Pin(GPIO_SWT1), INPUT); // Discard GPIO_SWT functionality SetPin(Pin(GPIO_SWT1), AGPIO(GPIO_NONE)); } - if (PinUsed(GPIO_SM2135_DAT, 1)) { - Sm2135.model = SM2135_WCBGR; - } - if (PinUsed(GPIO_SM2135_DAT, 2)) { - Sm2135.model = SM2135_WCGRBHI; - } - if (PinUsed(GPIO_SM2135_DAT, 3)) { - Sm2135.model = SM2135_WCBGRHI; - } // RGB current CW current Sm2135.current = (SM2135_20MA << 4) | SM2135_15MA; // See https://github.com/arendst/Tasmota/issues/6495#issuecomment-549121683