|
| 1 | +# Q10 VacuumTrait Test Scripts |
| 2 | + |
| 3 | +This directory contains test scripts for the Q10 VacuumTrait functionality added in [PR #754](https://github.com/Python-roborock/python-roborock/pull/754). |
| 4 | + |
| 5 | +## Scripts |
| 6 | + |
| 7 | +### test_q10_simple.py |
| 8 | +Interactive test script with detailed debug information. This script: |
| 9 | +- Shows comprehensive device information |
| 10 | +- Lists all available property APIs |
| 11 | +- Provides an interactive menu to test vacuum commands |
| 12 | +- Includes error handling and detailed output |
| 13 | + |
| 14 | +**Use this script when:** |
| 15 | +- You want to verify your device supports Q10 properties |
| 16 | +- You need to debug connection or API issues |
| 17 | +- You want detailed information about what's happening |
| 18 | + |
| 19 | +### test_q10_vacuum.py |
| 20 | +Basic test script for Q10 vacuum commands. A simpler version focused on testing the vacuum trait. |
| 21 | + |
| 22 | +### test_q10_advanced.py (NEW!) |
| 23 | +Advanced test suite with complex features and detailed diagnostics: |
| 24 | +- Tests multiple cleaning modes (standard, area, fast map) |
| 25 | +- Device status monitoring and diagnostics |
| 26 | +- Structured test suite with multiple test categories |
| 27 | +- Interactive menu for manual command testing |
| 28 | +- Full test suite execution |
| 29 | + |
| 30 | +**Use this script when:** |
| 31 | +- You want to test advanced cleaning modes |
| 32 | +- You need comprehensive diagnostics |
| 33 | +- You want to verify all VacuumTrait features |
| 34 | +- You're developing or debugging Q10 device support |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +### Quick Start |
| 39 | + |
| 40 | +1. Install the package in development mode: |
| 41 | +```bash |
| 42 | +python3 -m venv venv |
| 43 | +source venv/bin/activate |
| 44 | +pip install -e . |
| 45 | +``` |
| 46 | + |
| 47 | +2. Run a test script: |
| 48 | +```bash |
| 49 | +# Simple script with debugging |
| 50 | +python examples/Q10/test_q10_simple.py |
| 51 | + |
| 52 | +# Basic script (minimal output) |
| 53 | +python examples/Q10/test_q10_vacuum.py |
| 54 | + |
| 55 | +# Advanced script with diagnostics |
| 56 | +python examples/Q10/test_q10_advanced.py |
| 57 | +``` |
| 58 | + |
| 59 | +3. On first run, you'll be prompted to log in: |
| 60 | + - Enter your Roborock account email |
| 61 | + - A code will be sent to your email |
| 62 | + - Enter the code to complete authentication |
| 63 | + - Credentials are cached for future runs in `~/.cache/roborock-user-params.pkl` |
| 64 | + |
| 65 | +### What Each Script Does |
| 66 | + |
| 67 | +#### test_q10_simple.py |
| 68 | +```bash |
| 69 | +$ python examples/Q10/test_q10_simple.py |
| 70 | +📱 Found 1 device(s) |
| 71 | +Device 1: Roborock Q10 S5+ |
| 72 | +✅ Using device: Roborock Q10 S5+ |
| 73 | +✅ Device has Q10 properties! |
| 74 | +✅ Vacuum trait found: <roborock.devices.traits.b01.q10.vacuum.VacuumTrait ...> |
| 75 | +``` |
| 76 | +- Best for: Verifying device setup and API availability |
| 77 | +- Features: Full device diagnostics and comprehensive menu |
| 78 | + |
| 79 | +#### test_q10_vacuum.py |
| 80 | +```bash |
| 81 | +$ python examples/Q10/test_q10_vacuum.py |
| 82 | +📱 Found 1 device(s) |
| 83 | +1. Roborock Q10 S5+ (roborock.vacuum.ss07) |
| 84 | +✅ Using device: Roborock Q10 S5+ |
| 85 | +``` |
| 86 | +- Best for: Quick testing and command execution |
| 87 | +- Features: Minimal output, clean interface |
| 88 | + |
| 89 | +#### test_q10_advanced.py |
| 90 | +```bash |
| 91 | +$ python examples/Q10/test_q10_advanced.py |
| 92 | +[Main Menu] |
| 93 | +1. Run basic commands test |
| 94 | +2. Test advanced features |
| 95 | +3. Check device status |
| 96 | +4. Interactive menu |
| 97 | +5. Run all tests |
| 98 | +``` |
| 99 | +- Best for: Comprehensive testing and development |
| 100 | +- Features: Advanced modes, diagnostics, safety confirmations |
| 101 | + |
| 102 | +## Available Commands |
| 103 | + |
| 104 | +The VacuumTrait provides these commands: |
| 105 | + |
| 106 | +- **Start cleaning** - Initiates a full cleaning cycle |
| 107 | +- **Pause cleaning** - Pauses the current cleaning operation |
| 108 | +- **Resume cleaning** - Resumes a paused cleaning operation |
| 109 | +- **Stop cleaning** - Stops the cleaning operation completely |
| 110 | +- **Return to dock** - Sends the robot back to its charging dock |
| 111 | + |
| 112 | +### Advanced Cleaning Modes |
| 113 | + |
| 114 | +Additional cleaning modes can be tested with `test_q10_advanced.py` (option 2): |
| 115 | + |
| 116 | +- **Standard cleaning (cmd=1)** - Full cleaning cycle |
| 117 | +- **Electoral/Area cleaning (cmd=2)** - Clean specific areas/zones |
| 118 | +- **Fast map creation (cmd=4)** - Quickly generate room map |
| 119 | + - ⚠️ **Warning**: This will start the robot moving! |
| 120 | + - Requires explicit confirmation before execution |
| 121 | + |
| 122 | +### Device Status Information |
| 123 | + |
| 124 | +The `test_q10_advanced.py` script (option 3) provides: |
| 125 | + |
| 126 | +- **Connected**: Whether device is connected to Roborock services |
| 127 | +- **Local connected**: Whether device is reachable on your local network |
| 128 | + - `True` = Direct local connection (LAN/WiFi) |
| 129 | + - `False` = Cloud connection via Roborock servers |
| 130 | +- **Available APIs**: |
| 131 | + - `Command API` = Low-level command interface |
| 132 | + - `Vacuum Trait` = High-level vacuum control interface |
| 133 | + |
| 134 | +## Supported Devices |
| 135 | + |
| 136 | +These scripts are designed for Roborock Q10 devices that support the B01 Q10 protocol. The script will automatically detect if your device has the required `b01_q10_properties` API. |
| 137 | + |
| 138 | +## Troubleshooting |
| 139 | + |
| 140 | +### Device Issues |
| 141 | + |
| 142 | +**"This device doesn't have Q10 properties"** |
| 143 | +- Your device may not be a Q10 model |
| 144 | +- Check the device model shown in the output |
| 145 | +- The device might use a different API (v1_properties, b01_q7_properties, etc.) |
| 146 | +- Supported models: Roborock Q10 Series and compatible devices |
| 147 | + |
| 148 | +**Commands not working** |
| 149 | +- Ensure device is powered on and connected |
| 150 | +- Check that your account has proper permissions |
| 151 | +- Try stopping any active cleaning cycle first |
| 152 | +- Verify device is online in Roborock app |
| 153 | + |
| 154 | +### Authentication Issues |
| 155 | + |
| 156 | +**"Code login failed"** |
| 157 | +- Ensure you entered the code correctly |
| 158 | +- Codes expire after a few minutes - request a new one |
| 159 | +- Check your email spam folder for the code |
| 160 | + |
| 161 | +**"No cached login data found"** |
| 162 | +- Delete cached credentials: `rm ~/.cache/roborock-user-params.pkl` |
| 163 | +- Try logging in again with fresh credentials |
| 164 | +- Verify your email and password are correct |
| 165 | + |
| 166 | +### Connection Issues |
| 167 | + |
| 168 | +**Commands sent but no response** |
| 169 | +- Ensure device is online and connected to the internet |
| 170 | +- Check if your WiFi is stable |
| 171 | +- Try the device in the official Roborock app first |
| 172 | +- Verify the robot can reach Roborock servers |
| 173 | + |
| 174 | +**"Local connected: False"** |
| 175 | +- This is normal - device is using cloud connection |
| 176 | +- Commands may take a moment longer |
| 177 | +- Both local and cloud connections work fine |
| 178 | +- If you need local connection, configure device on same network |
| 179 | + |
| 180 | +## Related Documentation |
| 181 | + |
| 182 | +- [PR #754: Add VacuumTrait to q10 devices](https://github.com/Python-roborock/python-roborock/pull/754) |
| 183 | +- [PR #758: Add Q10 VacuumTrait Test Scripts](https://github.com/Python-roborock/python-roborock/pull/758) |
| 184 | +- [Main example script](../example.py) |
| 185 | +- [Supported Features](../../SUPPORTED_FEATURES.md) |
| 186 | +- [Device Manager Documentation](../../roborock/devices/README.md) |
| 187 | + |
| 188 | +## Testing Status |
| 189 | + |
| 190 | +✅ **Successfully tested with:** |
| 191 | +- Device: Roborock Q10 S5+ (`roborock.vacuum.ss07`) |
| 192 | +- All basic commands working (start, pause, resume, stop, return to dock) |
| 193 | +- Advanced modes available for testing |
| 194 | +- Cloud and local connection modes supported |
0 commit comments