Skip to content

feat: add commute and bedtime recipes - #24

Merged
wized2 merged 1 commit into
wized2:betafrom
anubhavaanand:feat/commute-bedtime-recipes
Nov 13, 2026
Merged

wized2 merged 1 commit into
wized2:betafrom
anubhavaanand:feat/commute-bedtime-recipes

Conversation

@anubhavaanand

@anubhavaanand anubhavaanand commented Nov 11, 2026 •

Copy link
Copy Markdown

Summary

Adds the two recipe packs requested in #22:

  • recipes/commute_bluetooth_music.json — Bluetooth connected -> media volume 80% + open a music app
  • recipes/bedtime_winddown.json — daily at 22:30 -> brightness 25% + ringer vibrate

Both are listed in recipes/README.md and docs/RECIPES.md, and neither uses shell actions. The bedtime recipe uses the default profile so it runs without switching profiles. Latch has no per-device Bluetooth filter yet, so the commute recipe fires for any Bluetooth device (noted in the recipe). The recipes include notes for the Bluetooth and Modify system settings permissions.

Import fix found while validating acceptance

The acceptance criterion says both files must import cleanly. The existing importer only accepted a bare JSON array, while all recipe files (including these two and the existing ones) use the documented {"rules":[...]} wrapper, so no recipe could import directly.

Added RuleJson.parseList() to accept either format, and tests that parse the two new recipe files through the same code path used by RuleStore.importJson(). The import dialog now says both formats are accepted. This also makes the existing recipes directly importable.

Target

  • beta (default)
  • main (stable hotfix only)

Checklist

  • PR targets beta unless hotfix
  • Tests for RuleLogic / pure helpers when applicable
  • No INTERNET / trackers added

Verification

./gradlew testStableDebugUnitTest --rerun-tasks
BUILD SUCCESSFUL — 20 tests, 0 failures

./gradlew assembleStableDebug assembleBetaDebug
BUILD SUCCESSFUL

./gradlew assembleStableRelease assembleBetaRelease
BUILD SUCCESSFUL

The recipe tests assert the values that make the recipes functional: enabled state, profile, trigger, time fields, action params, and ringer mode. I also validated every file under recipes/ as JSON with the expected {"rules":[...]} shape, known TriggerType/ActionType names, and no SHELL actions.

Closes #22.

Copilot AI balanced review requested due to automatic review settings November 11, 2026 17:38

Copilot AI left a comment

Copy link
Copy Markdown

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 insufficient remaining quota. Try requesting a review at a lower effort level.

@anubhavaanand

Copy link
Copy Markdown
Author

The Build & Release workflow is sitting in action_required because this is my first PR here. Could you approve the run? Local verification is in the PR description: unit tests, debug builds, and both release builds all pass.

@anubhavaanand
anubhavaanand force-pushed the feat/commute-bedtime-recipes branch from e4fa47d to 796d938 Compare November 11, 2026 17:48
@anubhavaanand
anubhavaanand force-pushed the feat/commute-bedtime-recipes branch from 796d938 to 4baab36 Compare November 11, 2026 18:37
@wized2
wized2 merged commit 8cf784a into wized2:beta Nov 13, 2026
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.

3 participants