Skip to content

Manage server schedules and verify native enablement synchronization - #60

Draft
pponce wants to merge 8 commits into
DonSidro:masterfrom
pponce:SCHEDULE_SUPPORT
Draft

pponce wants to merge 8 commits into
DonSidro:masterfrom
pponce:SCHEDULE_SUPPORT

Conversation

@pponce

@pponce pponce commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem and result

Imported server jobs were not visible through the legacy timer-only schedule page, and saving only the HTTP enabled flag could leave a native timer off. This adds a server-job schedule screen and shared, verified enable/disable handling.

Changes

  • List, create, edit and delete server jobs through the standard jobs API; retain separate legacy timer access.
  • Compact schedule cards sorted by start time; Start time, Once/Every day/Weekdays/Weekends/Custom repeat, Full/rooms and Vacuum/Vac & Mop/Mop/Custom controls.
  • Preserve job IDs, native references, room ordering, unedited cleaning settings and unknown fields.
  • Both list and editor Enabled controls read the existing native timer, update only when necessary, verify by get_server_timer, then save and confirm the server job.
  • Handle mismatched states, missing/ambiguous timers, timeouts, conflicts and partial saves without duplicate writes, automatic timer creation or blind rollback.
  • Keep jobs without a native name server-only, even when their method is server_scheduled_start.
  • Unrelated time/settings edits do not toggle native timers. Robot timer diagnostics stay under More details; unchecked is not presented as off.
  • Sign HTTP mutation bodies and DELETE requests correctly; add API, payload, authentication and enablement tests.

Dependencies and overlap

This is a draft proposal for reconciliation with #37.

Runtime requires the corresponding local_roborock_server schedule API/executor:
Python-roborock/local_roborock_server#213

That server work builds on:
Python-roborock/local_roborock_server#179

Merge/release the supporting server functionality before treating this client feature as generally available.

The companion admin dashboard/editor is:
Python-roborock/local_roborock_server#214

The admin dashboard is not a dependency of this app feature.

Relationship to #37 and #38

This is an independent implementation from master, not a branch built on #37. It overlaps #37 and the time-picker work in #38. Please coordinate on a combined approach before merging overlapping screens or APIs.

At #37 head 5f90884, native enablement already sends upd_server_timer followed by an HTTP job update. This PR adds fresh timer/server read-back, stale/conflicting job checks, duplicate-write prevention and explicit partial-save reporting.

This implementation also reads jobs directly over HTTP. In contrast, #37's fetchTimers reads get_timer, while the proposed server hardening intentionally keeps native jobs out of that legacy view.

Payload preservation differs: this PR retains raw job data and unknown fields and leaves native timer enablement unchanged during unrelated time/settings edits. #37 reconstructs typed settings and deletes/recreates native timer entries for edits.

#37 contributes native timer creation/deletion, feature-based protocol selection, SmartPlan/route support and date-specific one-time jobs that this PR does not replace. New jobs here are server-only; native timer lifecycle support needs a deliberate combined design. This implementation is not a superset of #37.

Proposed resolution

Retain #37's native protocol and model support, integrate direct jobs listing and this PR's payload preservation, verified-save behavior and regression tests, then agree on one final schedule UI.

These are source-level differences identifying cases to test. I have not reproduced each failure scenario on #37 hardware. I am happy to adapt or split this contribution around the maintainers' preferred approach.

Validation

I tested schedule control with LocalRock and the OEM Roborock app on an S7 (roborock.vacuum.a15, firmware 02.16.12), and the local server successfully started it at the scheduled time. Wider model/cleaning-mode and failure-path hardware coverage remains pending.

At daeb1f4, Android unit tests/build and iOS shared compilation passed:
https://github.com/pponce/LocalRock/actions/runs/40163225362

The automated suite covers both toggle directions, mismatched initial states, missing timers, connection failures, read-back verification, partial saves, conflicts and server-only jobs.

@pponce

pponce commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

providing screen shots of UI B9E7ABB0-003E-4C26-8E8B-EB45D225CC32_4_5005_c
F8F0D1B1-1886-43AD-989D-CA0E774C40F7_4_5005_c

@DonSidro

Copy link
Copy Markdown
Owner

Thanks, this is useful, especially the read-back checks. Before it can go in: please agree with @virtitnerd on one combined approach with #37, drop schedule-tests.yml (the repo won't take per-PR workflows), and rebase on master. It also has to wait for the server PRs.

@pponce

pponce commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @DonSidro. I agree with combining this with #37, rebasing on master, and removing the per-PR schedule-tests.yml workflow.

I want to clarify the use case I need to preserve: schedules executed by the local server at their due time, including imported jobs. With the server changes deployed, I tested schedule control using LocalRock and the OEM Roborock app on my S7 (a15, firmware 02.16.12), and confirmed that the local server started the vacuum at its scheduled time.

That confirms the server-triggered path works on my S7. I have not separately proved that every robot-only timer mode fails on it, so I don't want to overstate that result. But in my case i need the server to trigger the run.

The server scheduler builds on the still-open [server PR #179](Python-roborock/local_roborock_server#179). My [server PR #213](Python-roborock/local_roborock_server#213) adds native timer verification before dispatch, preservation of imported settings, persisted occurrence claims, and safeguards against starting an ordinary clean after a native scheduled-start refusal.

For the combined LocalRock approach, I would like to preserve:

  • Direct listing and editing of server jobs, including imported jobs and jobs without a native timer reference.
  • Existing IDs, native references and unedited/unknown settings.
  • Verified enable/disable handling and clear reporting of conflicts or partial saves.

#37 already contributes native timer lifecycle and model-specific support, and already works with server-triggered execution through #179. This is complementary work, not a claim that #37 lacks server scheduling.

I agree this should remain draft until we reconcile the implementations and the supporting server functionality is merged and released. The proposed order is server #179, then the remaining #213 changes, followed by the combined LocalRock work tested against that server. The separate [admin dashboard PR #214](Python-roborock/local_roborock_server#214) is not a dependency of LocalRock.

@DonSidro

Copy link
Copy Markdown
Owner

Thanks. I replied on #37 with the proposed split; let's keep the discussion about the combined version there.

@pponce

pponce commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

I’ve submitted a separate PR into @virtitnerd’s feat/schedule-rework branch to combine this work with #37, including the compact UI and verified server-job handling.

I’m keeping #60 open as a reference until the combined work is merged.

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