29 Commits
Author SHA1 Message Date
ClaudeandJames Woglom ddeaa79ded Fix #156: handle LidMalfunctionActivated in ProcessAlarm; add typed guardrail
ProcessAlarm.skip_event() read event.alarmId on every EventClass.ALARM event,
but LidMalfunctionActivated (a sibling of LidAlarmActivated in that class) has
no alarmId, so a malfunction alarm crashed the sync with AttributeError.

- Narrow with isinstance before reading alarmId; malfunction events now upload
  as "Malfunction" as intended, and sync continues.
- Type the alarm handlers against an explicit AlarmEvent union and add an
  assert_never exhaustiveness guard, so a type checker rejects unguarded
  subtype attribute access and flags any newly added ALARM event type.
- Fix a latent None-leak: alarm_to_nsentry now always returns a dict.
- Add mypy as a gradual-typing beachhead (setup.cfg [mypy], CI step, Pipfile
  typecheck script), scoped to process_alarm.py. This configuration fails on
  exactly the #156 class of bug.
- Add regression tests: malfunction processing, mixed alarm batches, the event
  shape, and an AlarmEvent/EventClass.ALARM sync guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LpMTd5LzkqFLZTUKd3H8em
2026-07-20 20:49:43 -04:00
James Woglom d8b57fe788 remove duplicate pipfile definitions also in setup.cfg, fix actions 2026-03-05 19:13:21 -05:00
James Woglom 9094976085 update for py3.8 2026-03-05 18:50:11 -05:00
James Woglom b592f6b464 ci 3.8: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process 2026-03-05 03:00:20 -05:00
James Woglom 4f2affe70f switch from pkg_resources to importlib_metadata 2026-03-05 02:54:45 -05:00
James Woglom 0733531f67 add setuptools dep 2026-03-05 02:50:33 -05:00
James Woglom 00023c6aba fix flake8 2024-12-12 00:27:35 -05:00
James Woglom 4f52927d2f try to fix jwt import error 2024-10-02 00:45:39 -04:00
James Woglom 8f2ad586fd v2.0.7: fix py3.7 compat 2024-10-01 17:17:33 -04:00
James Woglom 152c263fe0 Use pyjwt v2.8 to allow python3.7 support 2024-10-01 16:56:19 -04:00
James Woglom b862ea9d0d pin 2024-09-30 01:12:26 -04:00
James Woglom 2677fc86be pin arrow version for py3.7 compat 2024-09-30 01:09:25 -04:00
James Woglom 1ae40e3cdb python3.7 compat 2024-09-30 01:06:21 -04:00
James Woglom 60c2e08dcf py3.7 compat 2024-09-30 00:53:14 -04:00
James Woglom 362888cb14 update profiles 2024-09-29 23:06:42 -04:00
James Woglom abe8ea32aa fix event id 2024-09-29 22:13:21 -04:00
James Woglom a77ebb5429 TandemSource API 2024-09-18 22:49:40 -04:00
James Woglom ae2bf9a3a6 support proxy 2022-07-19 23:23:12 -04:00
James Woglom b4d0dad267 remove IOB feature in defaults because it is currently not displayed in the UI. document features in readme 2022-01-08 03:55:26 -05:00
James Woglom 2e5d8fc793 add setup.cfg/setup.py/pyproject.toml 2021-10-20 00:15:23 -04:00
James Woglom 87f531cbb3 tests: add iob test, fix sleep increment in ws2 tests 2021-10-14 02:02:57 -04:00
James Woglom 05c19fffa7 api/controliq: add login tests 2021-04-26 22:50:33 -04:00
James Woglom a3c7aa69a9 tests: add bolus parsing tests 2021-04-21 01:38:53 -04:00
James Woglom 4c6e05b2c1 tests: add Nightscout fake, tests for basal processing 2021-04-21 00:44:50 -04:00
James Woglom b7e8dceef1 Add dockerfile and instructions in README 2021-03-15 20:42:13 -04:00
Ben West d47aee77c9 pipenv install python-dotenv
Adding this library allows reading from standard environment files as well as
environment variables.
2021-03-14 21:50:35 -07:00
James Woglom 60f534d7b7 upload parsed tconnect bolus, basal, and iob entries to nightscout 2020-09-15 01:59:25 -04:00
James Woglom ef5f549275 process tconnect basal entries 2020-09-02 01:22:47 -04:00
James Woglom ab924c1ac2 initial commit: tandem t:connect api 2020-08-27 21:54:05 -04:00