Skip to content

Parse raw Wi-Fi scale records#46

Merged
sturimcode merged 1 commit into
sturimcode:mainfrom
gwgr:codex/raw-wifi-record-parser
Jul 9, 2026
Merged

Parse raw Wi-Fi scale records#46
sturimcode merged 1 commit into
sturimcode:mainfrom
gwgr:codex/raw-wifi-record-parser

Conversation

@gwgr

@gwgr gwgr commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • parse real raw Wi-Fi scale records with top-level weight and timestamp
  • keep recovered raw Wi-Fi measurements weight-only, with body composition fields left empty
  • update raw fallback tests so they use the observed raw endpoint shape instead of processed scale_data

Root Cause

The raw Wi-Fi fallback fetches wifi_scale/raw_data/{device_id}, but the returned records do not include scale_data. They were being passed through the processed-record parser, which discarded them as missing scale_data.

Validation

  • .venv/bin/pytest tests/test_eufy_client.py -v
  • .venv/bin/pytest tests/ -v
  • .venv/bin/eufy-sync --dry-run --verbose

Live dry-run verification recovered 2 weight-only measurements from the raw Wi-Fi endpoint and reported that it would sync both to Garmin.

Masked live dry-run output:

2026-07-09 13:34:30,647 INFO eufy_sync: Syncing user: default
2026-07-09 13:34:30,647 INFO eufy_sync.eufy_client: Using cached Eufy token from credential store (expires in 29 days)
2026-07-09 13:34:30,688 INFO eufy_sync.garmin_auth: Restored saved Garmin session
2026-07-09 13:34:30,688 INFO eufy_sync.garmin_client: Authenticated to Garmin Connect as REDACTED_EMAIL
2026-07-09 13:34:30,688 INFO eufy_sync: New sync target detected for default, backfilling 7 days
2026-07-09 13:34:32,598 INFO eufy_sync.eufy_client: Fetched 222 raw measurements from Eufy
2026-07-09 13:34:33,137 INFO httpx: HTTP Request: GET https://api.eufylife.com/v1/device/wifi_scale/raw_data/REDACTED_DEVICE_ID?after=REDACTED_TIMESTAMP "HTTP/1.1 200 OK"
2026-07-09 13:34:33,138 INFO eufy_sync.eufy_client: Recovered 2 weight-only measurement(s) from the raw Wi-Fi endpoint
2026-07-09 13:34:33,138 INFO eufy_sync: Found 2 measurements for default
2026-07-09 13:34:33,139 INFO eufy_sync: User default: synced {'garmin': 2}
[DRY RUN] Would sync to garmin: REDACTED_WEIGHT_1 kg at REDACTED_MEASUREMENT_TIME_1
[DRY RUN] Would sync to garmin: REDACTED_WEIGHT_2 kg at REDACTED_MEASUREMENT_TIME_2
[DRY RUN] Would sync 2 measurements to Garmin.

@sturimcode
sturimcode marked this pull request as ready for review July 9, 2026 12:11
@sturimcode
sturimcode merged commit a1a79f4 into sturimcode:main Jul 9, 2026
4 checks passed
sturimcode added a commit that referenced this pull request Jul 9, 2026
Ships the raw Wi-Fi record parser from #46 (thanks @gwgr) so headless
setups recover weight-only measurements before the phone app is opened.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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