mirror of https://github.com/arendst/Tasmota.git
Fix: Tuya Switches are detected as dimmers.
Tuya switches are detected as dimmers even after setting SetOption65 to 1. Currently SetOption65 just hides the dimmer from Web UI for Tuya switches with SetOption65 to 1 but they are advertised as dimmer to HASS. With this change we set light_type to LT_BASIC (on/off) instead of LT_SERIAL1 (dimmable) when option 65 is set.
This commit is contained in:
parent
1c7fd88ec4
commit
9fb804b426
|
@ -621,6 +621,9 @@ void CmndSetoption(void)
|
|||
if (18 == pindex) { // SetOption68 for multi-channel PWM, requires a reboot
|
||||
restart_flag = 2;
|
||||
}
|
||||
if (15 == pindex) { // SetOption65 for tuya_disable_dimmer requires a reboot
|
||||
restart_flag = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // SetOption32 .. 49
|
||||
|
|
|
@ -942,9 +942,7 @@ void HandleRoot(void)
|
|||
if ((LST_COLDWARM == (light_type &7)) || (LST_RGBWC == (light_type &7))) {
|
||||
WSContentSend_P(HTTP_MSG_SLIDER1, LightGetColorTemp());
|
||||
}
|
||||
if (!Settings.flag3.tuya_disable_dimmer) {
|
||||
WSContentSend_P(HTTP_MSG_SLIDER2, Settings.light_dimmer);
|
||||
}
|
||||
WSContentSend_P(HTTP_MSG_SLIDER2, Settings.light_dimmer);
|
||||
}
|
||||
#endif
|
||||
WSContentSend_P(HTTP_TABLE100);
|
||||
|
|
|
@ -291,7 +291,12 @@ bool TuyaModuleSelected(void)
|
|||
Settings.my_gp.io[3] = GPIO_TUYA_RX;
|
||||
restart_flag = 2;
|
||||
}
|
||||
light_type = LT_SERIAL1;
|
||||
if (Settings.flag3.tuya_disable_dimmer == 0) {
|
||||
light_type = LT_SERIAL1;
|
||||
} else {
|
||||
light_type = LT_BASIC;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue