From 7367aa5185ddf372218db8ca1f06f2acc672f725 Mon Sep 17 00:00:00 2001 From: Alex Albu Date: Mon, 3 Apr 2023 10:08:24 +0300 Subject: [PATCH] Fix PAYLOAD_DICT --- custom_components/localtuya/pytuya/__init__.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/custom_components/localtuya/pytuya/__init__.py b/custom_components/localtuya/pytuya/__init__.py index c4c89f0d5..82a455e52 100644 --- a/custom_components/localtuya/pytuya/__init__.py +++ b/custom_components/localtuya/pytuya/__init__.py @@ -261,12 +261,24 @@ class DecodeError(Exception): COMMAND_OVERRIDE: CONTROL_NEW, # Uses CONTROL_NEW command COMMAND: {"protocol": 5, "t": "int", "data": ""}, }, - DP_QUERY: {COMMAND_OVERRIDE: DP_QUERY_NEW}, + DP_QUERY: { + COMMAND_OVERRIDE: DP_QUERY_NEW, + COMMAND: {PARAMETER_GW_ID: "", PARAMETER_DEV_ID: "", PARAMETER_UID: "" }, + }, DP_QUERY_NEW: { - COMMAND: {PARAMETER_CID: ""}, + COMMAND: {PARAMETER_DEV_ID: "", PARAMETER_UID: "", PARAMETER_T: ""} }, HEART_BEAT: { - COMMAND: {} + COMMAND: {PARAMETER_GW_ID: "", PARAMETER_DEV_ID: ""} + }, + CONTROL_NEW: { + COMMAND: {PARAMETER_DEV_ID: "", PARAMETER_UID: "", PARAMETER_T: "", PARAMETER_CID: ""} + }, + STATUS: { # Get Status from Device + COMMAND: {PARAMETER_GW_ID: "", PARAMETER_DEV_ID: ""}, + }, + UPDATEDPS: { + COMMAND: {PARAMETER_DP_ID: [18, 19, 20]}, }, }, }