Repository navigation
Let schedules choose vacuum, mop and suction options - #30
virtitnerd wants to merge 3 commits into
Conversation
A schedule only had a time and weekdays, so it always ran with whatever
settings the robot happened to have. The official app lets each schedule
vacuum only, vacuum and mop, or mop only, with its own suction, water
level, mop route and pass count.
Those options now ride in the action object of set_timer and come back
in get_timer: ["start_clean", {"fan_power": 102, "water_box_mode": 200,
...}]. With none chosen the object is the {} this always sent, so a
robot or server that ignores the extra keys behaves as before. Tapping a
schedule opens it for editing; a dropped option is sent as null so it is
cleared instead of kept.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DonSidro
left a comment
There was a problem hiding this comment.
Thanks for this, it's a nice addition and the code is easy to follow. Tests pass on my end too.
Before I merge I want to make sure the robot actually uses these settings and doesn't just quietly ignore them. Could you try this on your Qrevo Pro:
- Make a schedule with something you'd notice, like Mop only or Max suction, then leave the Schedule screen and come back. Is it still there, with the same settings?
- If you can, send get_timer from HA or check your server log, and paste the entry. That shows whether the robot kept the keys.
- Let one run, or set one for a couple of minutes from now, and check that it really cleaned with those settings.
Also, a few changes I'd like:
- For editing, does set_timer with the same id replace the old schedule on your robot? If it does, I'd rather leave a removed option out instead of sending null, because some firmwares get picky about null values. If you're not sure, deleting the old schedule and adding it again is the safe way.
- Can createTimer and updateTimer check the robot's answer (requireOk) and show an error when it's refused? Right now a refused save looks like it worked. Someone hit exactly that in #28.
Once those are sorted I'm happy to merge it.
createTimer and updateTimer ignored the robot's reply, so a refused save looked like it worked. They now require an ok answer and the schedule screen shows the robot's error, then reads the list back so it matches what the robot holds. Editing no longer sends null for a dropped option, since some firmwares are picky about null values. It deletes the old schedule and adds it again with the same id and on/off state, and puts the old one back if the new one is refused. An option that is not chosen is simply left out. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each option row scrolled sideways, so in the edit dialog the chosen cleaning type (Mop) sat off-screen and the schedule looked unselected. The chips now wrap onto more lines. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for the review, and sorry for the churn. I'm closing this one and replacing it with #37 (the scheduling work) and #38 (the time picker, which stands on its own), because what I found while checking your three points changed what this PR needs to be. Your two requested changes were right and are the first commits of #37: a refused save is now shown as an error ( On your three checks, with one caveat: my setup answers
What changed the scope:
|
Problem
A schedule only had a time and weekdays, so it always ran with whatever settings the robot happened to have. The official app lets each schedule choose vacuum only, vacuum and mop, or mop only, each with its own suction, water level, mop route and pass count.
Changes
set_timerand come back inget_timer:["start_clean", {"fan_power": 102, "water_box_mode": 200, ...}]. With nothing chosen the object is the{}this app always sent, so a robot or server that ignores the extra keys behaves as before.TimerSettings(fan power, water, mop route, repeat) and aTimerKind(Current / Vacuum / Vac and mop / Mop) inCleanTimer.kt. Mopping without a water level falls back to medium, vacuum only drops water and route, mop only drops suction.nullso it is cleared instead of kept.Out of scope
Tested
TimerSettingsTestcovers kind detection, settings per kind and the action-object payload, including thenullclearing case../gradlew :composeApp:testDebugUnitTest: 200 tests, 0 failures.