Development¶
Repository layout¶
custom_components/apple_health_sync/ Home Assistant integration
ios/ SwiftUI app, Xcode project, Swift package
tests/ pytest + iOS contract tests
docs/ this site and screenshots
scripts/ payload simulator
.github/workflows/ tests, lint, hassfest, iOS, docs
The integration domain stays apple_health_sync; Health Assist is the product
name. The iOS bundle identifier is uk.co.thebillington.applehealthsync, and the
app targets iPhone.
Home Assistant tests¶
python3.13 -m venv .venv
source .venv/bin/activate
pip install -r requirements_test.txt
pytest
ruff check .
ruff format --check .
The suite covers webhook parsing, history validation, statistics metadata, config/options flows, QR data, dynamic sensors, state updates, diagnostics and contract alignment between the iOS catalog and the HA registry.
iOS build and tests¶
swift test --package-path ios/AppleHealthSyncCore
xcodebuild \
-project ios/AppleHealthSync.xcodeproj \
-scheme AppleHealthSync \
-sdk iphonesimulator \
CODE_SIGNING_ALLOWED=NO \
build
Regenerate the Xcode project after editing ios/project.yml:
CI¶
tests.yml: pytest.lint.yml: ruff.hassfest.yml: Home Assistant validation.ios.yml: Swift package tests and simulator build.docs.yml: MkDocs build and GitHub Pages deploy.
Production deployment¶
The author's Home Assistant instance is deployed through the separate
thebillington/homelab repository.
The energy Ansible role vendors this component and deploys it with a tagged
task. Do not edit the live component directly.
For local development, use a disposable Home Assistant container on a non-production host:
docker run -d --name ha-health-assist-test \
-p 8124:8123 \
-v "$PWD/custom_components/apple_health_sync:/config/custom_components/apple_health_sync:ro" \
ghcr.io/home-assistant/home-assistant:stable
Documentation site¶
The custom domain is healthassist.thebillington.co.uk; the CNAME lives in
docs/CNAME. GitHub Pages serves the site from the Actions workflow. DNS must
point the subdomain at GitHub Pages. If you use a proxy/Caddy instead, add the
corresponding DNS record and site block in the homelab repo.
Brand assets and screenshots¶
The app icon is generated by:
Marketing screenshots are generated with Open Screenshot Generator (osg) on
the homelab dev container. The OSG project/checkouts are environment-specific;
the final PNGs can be committed under docs/images/.
Known OSG limitations on the dev container:
- No MP4 preview videos (Chrome for Testing has no proprietary codecs).
- WebGL uses SwiftShader; 3D device frames are not identical to a real GPU.
- The CLI needs the pinned Node 20 under
/opt/node20; use/usr/local/bin/osgrather than a systemnpx.
Release checklist¶
- Update
manifest.jsonversion and iOSMARKETING_VERSION. - Run pytest, ruff, hassfest, Swift tests, simulator/device builds.
- Update the vendored homelab component and deploy it.
- Push
main, tag a release and publish release notes. - Confirm the docs workflow and GitHub Pages deployment.