Skip to content

Add in blood oxygen support into the mobile app.#267

Open
32bitx64bit wants to merge 13 commits into
coredevices:masterfrom
32bitx64bit:master
Open

Add in blood oxygen support into the mobile app.#267
32bitx64bit wants to merge 13 commits into
coredevices:masterfrom
32bitx64bit:master

Conversation

@32bitx64bit

@32bitx64bit 32bitx64bit commented Jun 24, 2026

Copy link
Copy Markdown

Adds in blood oxygen support and settings into the mobile app.

Related commits :
coredevices/PebbleOS#1607
coredevices/pebbleos-nonfree#4

32bitx64bit and others added 13 commits June 17, 2026 04:18
Introduce a dedicated spo2_readings table for per-minute blood oxygen
samples parsed from the watch's health stream, with an auto-migration
from schema 38 to 39 and the exported schema. SpO2 is stored separately
from HealthDataEntity because real readings are sparse (one per
measurement interval) and keyed/deduped by minute timestamp.
ActivityMinuteData record version 14 appends spo2_percent and
spo2_quality to each minute sample. parseStepsData now returns
ParsedHealthData carrying both the step/HR entities and any SpO2
readings (only samples where spo2_percent > 0 are emitted). Adds a
v14 parsing test plus a v13 backward-compatibility test.
Wire the new ParsedHealthData through processStepsData: insert step/HR
records and SpO2 readings independently so a payload carrying only one
of the two is still handled, and surface the SpO2 count in the debug
summary.
Add SpO2 query methods (range readings, readings-after cursor, average,
latest) and a LatestSpo2 model to HealthDataApi, implement them in
Health against the new spo2Dao, and stub them in FakeLibPebble. Also
threads the bloodOxygenEnabled flag into the HealthSettings model.
Add a bloodOxygenPreferences health setting (single enabled byte,
defaults off) that the watch gates SpO2 measurement on. Encodes/decodes
the blob, routes the key from the WatchPrefs BlobDB to HealthParams, and
adds a Blood Oxygen toggle under Health settings (shown only when
tracking + HRM are enabled).
health-kmp 1.4.0 doesn't model OxygenSaturation, so add expect/actual
seams for blood-oxygen platform writing: Android writes via
androidx.health.connect with a dedicated translucent permission
activity, iOS is a no-op for now. PlatformHealthSync requests the extra
permission and syncs SpO2 records using its own last-synced cursor.
Show a Blood Oxygen card (latest/average plus a daily SpO2 line chart
scaled to the 85-100 band with scrub support) on the Health screen for
HRM-capable watches, backed by a new Spo2UiState bucketed at 5-minute
resolution in the view model.
@CLAassistant

CLAassistant commented Jun 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@toxuin

toxuin commented Jun 27, 2026

Copy link
Copy Markdown

Tested for ~2 days, results compared with Ultrahuman Ring Air: differences are within 1%. No crashing or weirdness spotted. It looks quite nice, actually.

screenshot

@ericmigi

ericmigi commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

that's awesome! We're relatively busy, but I'll try to schedule this over the next couple weeks to merge.

@32bitx64bit

Copy link
Copy Markdown
Author

that's awesome! We're relatively busy, but I'll try to schedule this over the next couple weeks to merge.

Awesome to hear ❤️

Love the work y'all put into Pebble!

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.

4 participants