mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-10 03:17:42 +00:00
Merge pull request #6733 from shantur/development
TuyaMcu: Fix Relays aren't using correct DpIds.
This commit is contained in:
commit
9eff75fd81
@ -276,8 +276,11 @@ bool TuyaSetPower(void)
|
|||||||
uint8_t rpower = XdrvMailbox.index;
|
uint8_t rpower = XdrvMailbox.index;
|
||||||
int16_t source = XdrvMailbox.payload;
|
int16_t source = XdrvMailbox.payload;
|
||||||
|
|
||||||
|
uint8_t dpid = TuyaGetDpId(TUYA_MCU_FUNC_REL1 + active_device - 1);
|
||||||
|
if (dpid == 0) dpid = TuyaGetDpId(TUYA_MCU_FUNC_REL1_INV + active_device - 1);
|
||||||
|
|
||||||
if (source != SRC_SWITCH && TuyaSerial) { // ignore to prevent loop from pushing state from faceplate interaction
|
if (source != SRC_SWITCH && TuyaSerial) { // ignore to prevent loop from pushing state from faceplate interaction
|
||||||
TuyaSendBool(active_device, bitRead(rpower, active_device-1) ^ bitRead(rel_inverted, active_device-1));
|
TuyaSendBool(dpid, bitRead(rpower, active_device-1) ^ bitRead(rel_inverted, active_device-1));
|
||||||
status = true;
|
status = true;
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user