Merge pull request #16504 from ZoneMR/patch-1

Update xdrv_16_tuyamcu.ino
This commit is contained in:
Theo Arends 2022-09-13 15:24:15 +02:00 committed by GitHub
commit 912be0b4c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -802,7 +802,7 @@ void TuyaProcessStatePacket(void) {
if (Tuya.buffer[dpidStart + 1] == 0) {
#ifdef USE_ENERGY_SENSOR
if (tuya_energy_enabled && fnId == TUYA_MCU_FUNC_POWER_COMBINED) {
if (dpDataLen == 8) {
if (dpDataLen >= 8) {
uint16_t tmpVol = Tuya.buffer[dpidStart + 4] << 8 | Tuya.buffer[dpidStart + 5];
uint16_t tmpCur = Tuya.buffer[dpidStart + 7] << 8 | Tuya.buffer[dpidStart + 8];
uint16_t tmpPow = Tuya.buffer[dpidStart + 10] << 8 | Tuya.buffer[dpidStart + 11];