From 47ae5bc9c831d8ecddcf7277cd53601deb0cc11f Mon Sep 17 00:00:00 2001 From: Marcus Better Date: Mon, 4 Mar 2024 07:23:12 -0500 Subject: [PATCH] [tuyamcu_v2] Send updates unconditionally (#20868) Remove the logic that inhibits the sending of updates to the MCU until the DP's state has been observed at least once in a status report from the MCU. This logic was intended to ensure that a DP is not updated with its current value, which reportedly crashes some very broken devices. However, other devices like the Feit DIM/WIFI dimmers do not reliably report DPs that haven't been changed. So the required status report would never arrive, resulting in the inability to control these devices remotely, at least until their state had been changed by a manual button press, something that is not always practical as it requires physical device access and needs to be done after every restart. Removing this logic allows Tasmota to control the device state. --- tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino index d477d67d1..850bb6854 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino @@ -888,7 +888,7 @@ void Tuya_statemachine(int cmd = -1, int len = 0, unsigned char *payload = (unsi for (i = 0; i < pTuya->numRxedDPids; i++){ TUYA_DP_STORE *dp = &pTuya->DPStore[i]; // if set requested, and MCU has reported at least once - if (dp->toSet && dp->rxed){ + if (dp->toSet) { // if value is different if ((dp->rxedValueLen != dp->desiredValueLen) || memcmp(dp->rxedValue, dp->desiredValue, dp->desiredValueLen)){ uint8_t send = 1;