(self, params: Union[str, dict], **kwargs)
| 87 | super().__init__(cfg) |
| 88 | |
| 89 | def call(self, params: Union[str, dict], **kwargs): |
| 90 | params = self._verify_json_format_args(params) |
| 91 | action = params["action"] |
| 92 | if action == "key": |
| 93 | return self._key(params["text"]) |
| 94 | elif action == "click": |
| 95 | return self._click( |
| 96 | coordinate=params["coordinate"] |
| 97 | ) |
| 98 | elif action == "long_press": |
| 99 | return self._long_press( |
| 100 | coordinate=params["coordinate"], time=params["time"] |
| 101 | ) |
| 102 | elif action == "swipe": |
| 103 | return self._swipe( |
| 104 | coordinate=params["coordinate"], coordinate2=params["coordinate2"] |
| 105 | ) |
| 106 | elif action == "type": |
| 107 | return self._type(params["text"]) |
| 108 | elif action == "system_button": |
| 109 | return self._system_button(params["button"]) |
| 110 | elif action == "open": |
| 111 | return self._open(params["text"]) |
| 112 | elif action == "wait": |
| 113 | return self._wait(params["time"]) |
| 114 | elif action == "terminate": |
| 115 | return self._terminate(params["status"]) |
| 116 | else: |
| 117 | raise ValueError(f"Unknown action: {action}") |
| 118 | |
| 119 | def _key(self, text: str): |
| 120 | raise NotImplementedError() |
nothing calls this directly
no test coverage detected