sync_data
Downloads chosen Mi Fitness datasets from Xiaomi into local SQLite, with incremental watermark sync or forced full sync, and returns per-type results.
Instructions
Download selected Mi Fitness datasets from Xiaomi into local SQLite; writes records and sync watermarks, may authenticate/rotate local credentials, and does not modify cloud health records. Requires local CLI setup and user authorization to access the account. Omitted data_types selects all adapter-supported types; an empty list is invalid. Dates are inclusive YYYY-MM-DD; start_date must not exceed end_date. Omitted end_date uses today; omitted start_date resumes the watermark or uses configured lookback (default 30 days). force_full_sync ignores the watermark, not the requested date range, and does not erase the database. Only one sync runs at a time. background=false waits for status ok/partial/error, sync_id, record counts and per-type results; background=true returns accepted plus sync_id to poll with get_sync_status. Partial results may already be stored; inspect results before retrying. Use cached query tools instead when no refresh is needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | No | Inclusive last calendar date, YYYY-MM-DD; must be on or after start_date. Omitted: server local today. | |
| background | No | False waits for results; true starts a process-local task and returns sync_id for get_sync_status polling. | |
| data_types | No | Dataset names; omitted selects all adapter-supported datasets; [] is invalid. | |
| start_date | No | Inclusive first calendar date, YYYY-MM-DD; must be on or before end_date. Uses stored calendar dates, not caller timezone conversion. Omitted: saved watermark, or configured lookback (default 30 days) if no watermark/force_full_sync=true. | |
| force_full_sync | No | Ignore saved sync watermark and re-fetch the requested range; no deletion. If start_date is omitted use configured lookback. |