mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-01 23:17:43 +00:00
update the Code to prevent the multiple power mqtt
update the xdrv_16_tuyadimmer.ino to prevent the multiple mqtt msg for power status.
This commit is contained in:
parent
a802d76713
commit
86af0df712
@ -195,11 +195,14 @@ void TuyaPacketProcess(void)
|
|||||||
case TUYA_CMD_STATE:
|
case TUYA_CMD_STATE:
|
||||||
if (tuya_buffer[5] == 5) { // on/off packet
|
if (tuya_buffer[5] == 5) { // on/off packet
|
||||||
|
|
||||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("TYA: RX Device -%d --> %s State"),tuya_buffer[6],tuya_buffer[10]?"On":"Off");
|
|
||||||
ExecuteCommandPower(tuya_buffer[6], tuya_buffer[10], SRC_SWITCH); // send SRC_SWITCH? to use as flag to prevent loop from inbound states from faceplate interaction
|
|
||||||
/*if((power || Settings.light_dimmer > 0) && (power != tuya_buffer[10])) {
|
/*if((power || Settings.light_dimmer > 0) && (power != tuya_buffer[10])) {
|
||||||
ExecuteCommandPower(1, tuya_buffer[10], SRC_SWITCH); // send SRC_SWITCH? to use as flag to prevent loop from inbound states from faceplate interaction
|
ExecuteCommandPower(1, tuya_buffer[10], SRC_SWITCH); // send SRC_SWITCH? to use as flag to prevent loop from inbound states from faceplate interaction
|
||||||
}*/
|
}*/
|
||||||
|
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("TYA: RX Device-%d --> MCU State: %s Current State:%s"),tuya_buffer[6],tuya_buffer[10]?"On":"Off",bitRead(power, tuya_buffer[6]-1)?"On":"Off");
|
||||||
|
if((power || Settings.light_dimmer > 0) && (tuya_buffer[10] != bitRead(power, tuya_buffer[6]-1)))
|
||||||
|
{
|
||||||
|
ExecuteCommandPower(tuya_buffer[6], tuya_buffer[10], SRC_SWITCH); // send SRC_SWITCH? to use as flag to prevent loop from inbound states from faceplate interaction
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (tuya_buffer[5] == 8) { // dim packet
|
else if (tuya_buffer[5] == 8) { // dim packet
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user