[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.
This commit is contained in:
Marcus Better 2024-03-04 07:23:12 -05:00 committed by GitHub
parent bb790efefd
commit 47ae5bc9c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;