mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-24 06:46:26 +01:00
phone_app: the alarm now syncs through the shared crdt_sync transport
(v0.2.0) into the fixed private repo kuhyx/syncs, replacing the bespoke
Gist. AlarmSyncService is the sole writer: it holds the alarm locally in a
crdt_sync LogStore (one HLC-stamped Record) and pushes it to
wake-alarm-sync/devices/phone/alarm.json. gist_service.dart is deleted;
SyncSettings drops the Gist id and keeps only a token; the device-flow scope
moves from `gist` to `repo` (the Contents API needs private-repo access).
shutdown-wrapper.sh: the PC reader now fetches that alarm from the Contents
API (Accept: application/vnd.github.raw, so no base64) and parses the
crdt_sync Record Log with jq (.alarm.fields.alarm_hour[0]). Single-file read
of the sole "phone" device; unchanged fallback to WAKE_AFTER_HOURS on any
miss so a parse failure can never brick the wake. Config moves from
gist_sync.json {token, gist_id} to sync.json {token}.
Verified: flutter analyze clean + tests pass; shellcheck clean and the full
get_synced_alarm_epoch verified against the real Log format; on-device the
app builds, installs with adb install -r (no data loss), launches and
renders. Live round-trip needs a one-time repo-scoped re-auth on the phone
and ~/.config/wake_alarm/sync.json on the PC.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019KwUCPESvE5CjCtmUFz8xQ
34 lines
707 B
YAML
34 lines
707 B
YAML
name: wake_alarm_sync
|
|
description: "Wake alarm phone-side sync app — sets the phone alarm and syncs the time to the PC via the shared crdt_sync transport."
|
|
publish_to: 'none'
|
|
|
|
version: 1.0.0+1
|
|
|
|
environment:
|
|
sdk: ^3.12.2
|
|
|
|
dependencies:
|
|
android_intent_plus: ^5.0.0
|
|
crdt_sync:
|
|
git:
|
|
url: https://github.com/kuhyx/utils
|
|
ref: crdt_sync_dart-v0.2.0
|
|
path: crdt_sync_dart
|
|
cupertino_icons: ^1.0.8
|
|
flutter:
|
|
sdk: flutter
|
|
flutter_secure_storage: ^9.0.0
|
|
http: ^1.2.0
|
|
path: ^1.9.0
|
|
path_provider: ^2.1.0
|
|
shared_preferences: ^2.3.0
|
|
url_launcher: ^6.3.0
|
|
|
|
dev_dependencies:
|
|
flutter_test:
|
|
sdk: flutter
|
|
very_good_analysis: ^10.2.0
|
|
|
|
flutter:
|
|
uses-material-design: true
|