-
-
Notifications
You must be signed in to change notification settings - Fork 706
Open
Description
Description
The scroll command on Android requires x and y parameters, but calling it with just direction fails with a confusing error.
Steps to Reproduce
curl -X POST http://localhost:8000/cmd -H "Content-Type: application/json" \
-d '{"command":"scroll","params":{"direction":"down"}}'Error
{"success": false, "error": "AndroidAutomationHandler.scroll() missing 2 required positional arguments: 'x' and 'y'"}Expected Behavior
Either:
- The
scrollcommand should work with justdirection(using screen center as default) - Or the error message should clearly indicate that
xandyare required on Android
Suggested Fix
In AndroidAutomationHandler.scroll(), provide default values for x and y:
async def scroll(self, direction: str, x: int = None, y: int = None, amount: int = 1):
if x is None or y is None:
# Use screen center as default
screen_size = await self.get_screen_size()
x = x or screen_size['width'] // 2
y = y or screen_size['height'] // 2
# ... rest of implementationEnvironment
- cua-computer-server: 0.3.9
- Platform: Android 11 (emulator)
Metadata
Metadata
Assignees
Labels
No labels