Skip to content

feat: add cloud job updates to API and CLI - #994

Open
Lash-L wants to merge 3 commits into
mainfrom
feat/update-job
Open

Lash-L wants to merge 3 commits into
mainfrom
feat/update-job

Conversation

@Lash-L

@Lash-L Lash-L commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Add cloud job editing through the Python API and CLI.

RoborockApiClient.update_job(user_data, device_id, job) sends PUT /user/devices/{duid}/jobs/{jobId} using a HomeDataSchedule. It uses the ID in the URL and sends the remaining schedule fields as a complete replacement, signing and sending identical compact JSON bytes without changing the input schedule.

The CLI uses cached login credentials:

roborock update-job --device_id DEVICE_ID --job-file schedule.json

It parses the JSON file with the existing HomeDataSchedule.from_dict() and calls update_job(). Parsing or update failures are printed with a nonzero exit status. Include the full schedule and existing cleaning parameters in the input file.

Validation:

  • uv run pytest -q: 1,605 passed, 53 xfailed, 11 deselected.
  • uv run pre-commit run --all-files: all hooks passed.
  • Additional Mypy check of tests/test_cli.py passed.
  • API tests cover request signatures, payloads, preserved input, credentials, response failures, and network failures. Three CLI tests cover successful invocation, JSON parsing failure, and cloud failure.

HTTP behavior is tested with mocks; no live account or device calls were made.

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
roborock/cli.py 38.86% <100.00%> (+2.86%) ⬆️
roborock/web_api.py 55.89% <100.00%> (+0.98%) ⬆️
tests/test_cli.py 100.00% <100.00%> (ø)
tests/test_web_api.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Lash-L

Lash-L commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

separate from this PR - what are your thoughts about breaking up web_api

Been thinking about biting the bullet and adding a bunch of web endpoints so that a lot of tricky functionality is possible (opens up a lot of doors for agents as well imo).

But as this file gets longer and longer, I wonder if it should be separate files. e.g. /user/homes is in a 'homes' folder under web_api. and 'devices' and 'scenes', etc.

@Lash-L Lash-L changed the title feat(web_api): add cloud job updates feat: add cloud job updates to API and CLI Oct 22, 2026
@Lash-L
Lash-L marked this pull request as ready for review October 22, 2026 01:34
Copilot AI balanced review requested due to automatic review settings October 22, 2026 01:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants