Fetch the latest-used Nightscout pump profile (/api/v1/profile) via a new fetch_profile() in nightscout_client.py, reusing the existing auth/base-URL helpers.
New framework-free profile_data.py module parses the raw profile into normalized basal/ISF/carb-ratio/target segments (minutes-since-midnight, mg/dL→mmol/L conversion where needed) and DIA.
New pages/9_Insulineprofiel.py dashboard page: basal-rate bar/area chart by hour of day, plus tables for basal, ISF, and carb-ratio segments.
ui_common.py: new load_profile() cache wrapper (6h TTL) and new palette colors (basal, bolus_food, bolus_correction, bolus_smb, target) for reuse in the follow-up chart-overlay PR.
This is PR 1/4 of the insulin-profile/treatment-overlay/report-redesign work, branched from main. See plan context: profile data is the foundation the next PRs (chart overlays, PDF redesign) build on.
Manually launched the app (streamlit run app.py) against the real configured Nightscout instance and confirmed the Insulineprofiel page renders real basal/ISF/carb-ratio data with no exceptions or console errors (verified via headless Playwright + screenshots)
## Summary
- Fetch the latest-used Nightscout pump profile (`/api/v1/profile`) via a new `fetch_profile()` in `nightscout_client.py`, reusing the existing auth/base-URL helpers.
- New framework-free `profile_data.py` module parses the raw profile into normalized basal/ISF/carb-ratio/target segments (minutes-since-midnight, mg/dL→mmol/L conversion where needed) and DIA.
- New `pages/9_Insulineprofiel.py` dashboard page: basal-rate bar/area chart by hour of day, plus tables for basal, ISF, and carb-ratio segments.
- `ui_common.py`: new `load_profile()` cache wrapper (6h TTL) and new palette colors (`basal`, `bolus_food`, `bolus_correction`, `bolus_smb`, `target`) for reuse in the follow-up chart-overlay PR.
This is PR 1/4 of the insulin-profile/treatment-overlay/report-redesign work, branched from `main`. See plan context: profile data is the foundation the next PRs (chart overlays, PDF redesign) build on.
## Test plan
- [x] `ruff check .` passes
- [x] `pytest tests/ -v` passes (96 tests, +23 new: `tests/test_profile_data.py` + `fetch_profile` tests in `tests/test_nightscout_client.py`)
- [x] Manually launched the app (`streamlit run app.py`) against the real configured Nightscout instance and confirmed the Insulineprofiel page renders real basal/ISF/carb-ratio data with no exceptions or console errors (verified via headless Playwright + screenshots)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fetch and parse the latest-used Nightscout profile (basal schedule, ISF,
carb ratio, DIA, targets) and show it as a new dashboard page: a list of
basal/ISF/carb-ratio segments plus a bar chart of basal rate by hour of
day. This is the data foundation for treatment overlays on the glucose
charts and the redesigned PDF report in follow-up PRs.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
/api/v1/profile) via a newfetch_profile()innightscout_client.py, reusing the existing auth/base-URL helpers.profile_data.pymodule parses the raw profile into normalized basal/ISF/carb-ratio/target segments (minutes-since-midnight, mg/dL→mmol/L conversion where needed) and DIA.pages/9_Insulineprofiel.pydashboard page: basal-rate bar/area chart by hour of day, plus tables for basal, ISF, and carb-ratio segments.ui_common.py: newload_profile()cache wrapper (6h TTL) and new palette colors (basal,bolus_food,bolus_correction,bolus_smb,target) for reuse in the follow-up chart-overlay PR.This is PR 1/4 of the insulin-profile/treatment-overlay/report-redesign work, branched from
main. See plan context: profile data is the foundation the next PRs (chart overlays, PDF redesign) build on.Test plan
ruff check .passespytest tests/ -vpasses (96 tests, +23 new:tests/test_profile_data.py+fetch_profiletests intests/test_nightscout_client.py)streamlit run app.py) against the real configured Nightscout instance and confirmed the Insulineprofiel page renders real basal/ISF/carb-ratio data with no exceptions or console errors (verified via headless Playwright + screenshots)🤖 Generated with Claude Code