From c012e6201ea53d3c3ca6ce119fbb3c56d7f5a71e Mon Sep 17 00:00:00 2001 From: trance233 <57557139+popjdh@users.noreply.github.com> Date: Sat, 17 Dec 2022 16:47:40 +0800 Subject: [PATCH] Update asst.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正Python枚举类型使用错误 --- src/Python/asst.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Python/asst.py b/src/Python/asst.py index 2f44f3d746..9ae42b2cd2 100644 --- a/src/Python/asst.py +++ b/src/Python/asst.py @@ -5,12 +5,12 @@ import platform import json from typing import Union, Dict, List, Any, Type, Optional -from enum import Enum, unique, auto +from enum import Enum, IntEnum, unique, auto JSON = Union[Dict[str, Any], List[Any], int, str, float, bool, Type[None]] -class InstanceOptionType(Enum): +class InstanceOptionType(IntEnum): touch_type: 2 deployment_with_pause: 3 @@ -90,7 +90,7 @@ class Asst: :return: 是否设置成功 """ return Asst.__lib.AsstSetInstanceOption(self.__ptr, - option_type, option_value.encode('utf-8')) + int(option_type), option_value.encode('utf-8')) def connect(self, adb_path: str, address: str, config: str = 'General', touch_config: str = 'minitouch'):