Handle swipe action.
(self, action: dict, width: int, height: int)
| 173 | return ActionResult(True, False) |
| 174 | |
| 175 | def _handle_swipe(self, action: dict, width: int, height: int) -> ActionResult: |
| 176 | """Handle swipe action.""" |
| 177 | start = action.get("start") |
| 178 | end = action.get("end") |
| 179 | |
| 180 | if not start or not end: |
| 181 | return ActionResult(False, False, "Missing swipe coordinates") |
| 182 | |
| 183 | start_x, start_y = self._convert_relative_to_absolute(start, width, height) |
| 184 | end_x, end_y = self._convert_relative_to_absolute(end, width, height) |
| 185 | |
| 186 | device_factory = get_device_factory() |
| 187 | device_factory.swipe(start_x, start_y, end_x, end_y, device_id=self.device_id) |
| 188 | return ActionResult(True, False) |
| 189 | |
| 190 | def _handle_back(self, action: dict, width: int, height: int) -> ActionResult: |
| 191 | """Handle back button action.""" |
nothing calls this directly
no test coverage detected