Skip to content

Commit

Permalink
perf: python return values, add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed May 27, 2024
1 parent 1460ed4 commit e9a7992
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/binding/Python/maa/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class RecognitionDetail:
name: str
hit_box: Optional[Rect]
detail: Dict
raw: numpy.ndarray
draws: List[numpy.ndarray]
raw: numpy.ndarray # Instance.set_debug_message(true) to get this
draws: List[numpy.ndarray] # Instance.set_debug_message(true) to get this


@dataclass
Expand Down Expand Up @@ -140,7 +140,7 @@ async def run_task(self, task_type: str, param: Dict = {}) -> Optional[TaskDetai

async def run_recognition(
self, task_type: str, param: Dict = {}
) -> Optional[NodeDetail]:
) -> Optional[RecognitionDetail]:
"""
Async run a recognition.
Expand All @@ -157,7 +157,7 @@ async def run_recognition(
if not detail or not detail.node_details:
return None

return detail.node_details[0]
return detail.node_details[0].recognition

async def run_action(
self, task_type: str, param: Dict = {}
Expand All @@ -167,7 +167,7 @@ async def run_action(
:param task_type: The name of the action.
:param param: The param of the action.
:return: details of the action.
:return: details of the node.
"""

future = self.post_action(task_type, param)
Expand Down

0 comments on commit e9a7992

Please sign in to comment.