diff --git a/custom_components/midea_auto_cloud/core/device.py b/custom_components/midea_auto_cloud/core/device.py index 5206b8c..f66fc3c 100644 --- a/custom_components/midea_auto_cloud/core/device.py +++ b/custom_components/midea_auto_cloud/core/device.py @@ -168,7 +168,7 @@ class MiedaDevice(threading.Thread): nested_status = self._convert_to_nested_structure(new_status) try: - if set_cmd := self._lua_runtime.build_control(nested_status): + if set_cmd := self._lua_runtime.build_control(nested_status, status=self._attributes): await self._build_send(set_cmd) return except Exception as e: @@ -194,7 +194,7 @@ class MiedaDevice(threading.Thread): if has_new: try: - if set_cmd := self._lua_runtime.build_control(nested_status): + if set_cmd := self._lua_runtime.build_control(nested_status, status=self._attributes): await self._build_send(set_cmd) return except Exception as e: diff --git a/custom_components/midea_auto_cloud/core/lua_runtime.py b/custom_components/midea_auto_cloud/core/lua_runtime.py index 8501026..f9a504d 100644 --- a/custom_components/midea_auto_cloud/core/lua_runtime.py +++ b/custom_components/midea_auto_cloud/core/lua_runtime.py @@ -56,9 +56,10 @@ class MideaCodec(LuaRuntime): MideaLogger.error(f"LuaRuntimeError in build_query {json_str}: {repr(e)}") return None - def build_control(self, append=None): + def build_control(self, append=None, status=None): query_dict = self._build_base_dict() query_dict["control"] = {} if append is None else append + query_dict["status"] = {} if status is None else status # 针对T0xD9复式洗衣机特殊处理 if self._device_type == "T0xD9": control_keys = list(append.keys())