Commit Graph
68 Commits
Author SHA1 Message Date
James Woglom 878cd5b247 api/controliq: retry/relogin on http errors, add tests 2021-04-26 22:50:33 -04:00
James WoglomandGitHub 9c8e5c150c Add codecov badge 2021-04-24 23:36:38 -04:00
James WoglomandGitHub 01d9517ff4 Add codecov 2021-04-24 23:24:01 -04:00
James Woglom e7816c4aa0 tests/api: test ws2 therapy_timeline_csv parsing 2021-04-24 23:12:36 -04:00
James Woglom 18f1149b28 tests: add ws2 api tests for retries 2021-04-24 22:48:45 -04:00
James Woglom fe941c432f api/ws2: add retry logic for http 500s in therapy_timeline_csv (fix #9) 2021-04-24 22:27:07 -04:00
James WoglomandGitHub 71ceb94270 Merge pull request #8 from jwoglom/develop
version 0.2.0
v0.2.0
2021-04-21 01:43:43 -04:00
James Woglom a3c7aa69a9 tests: add bolus parsing tests 2021-04-21 01:38:53 -04:00
James Woglom 093a7f0627 tests: add bolus tests 2021-04-21 01:27:13 -04:00
James Woglom e1921ccac7 tests/api: override needs_relogin in ControlIQApi 2021-04-21 00:53:58 -04:00
James Woglom 52f7972153 api/controliq: check access token expiration time 2021-04-21 00:51:27 -04:00
James Woglom 2130099f70 sync/basal: fix duplicate upload error uncovered by tests 2021-04-21 00:45:36 -04:00
James Woglom 4c6e05b2c1 tests: add Nightscout fake, tests for basal processing 2021-04-21 00:44:50 -04:00
James Woglom cda01894dc add basic fake for tconnect api classes 2021-04-20 00:52:11 -04:00
James Woglom 7a18a5d4be run CI on develop branch 2021-04-20 00:27:52 -04:00
James Woglom 4b8ddd0cec nightscout.py: move methods into class, initialize NightscoutApi in main
Changes all code which interacts with the nightscout api to
invoke it via a NightscoutApi object which is passed to it
and defined in the main, rather than having utility methods
in nightscout.py which rely on the global secret file state
of nightscout url/secret.
2021-04-20 00:26:18 -04:00
James Woglom 1efe532a2f tests: add parser tests for nightscout 2021-04-20 00:07:09 -04:00
James Woglom 8dcbee4280 bugfix: use access token expire date in android api
Before an instance of the android api is invoked via the TConnectApi
wrapper, the needs_relogin method is called to see whether the
current access token has expired. That check was using the refresh
token expiration date instead of the access token expiration date.
(The refresh tokens in the android api are currently unused.)
2021-04-19 23:53:55 -04:00
James Woglom c7aac1dca3 update pipfile.lock: fix CVE-2021-28957 2021-04-06 13:18:19 -04:00
James WoglomandGitHub 739c01f876 Merge pull request #4 from LegendaryGeek/master
Update README.md to correct the docker run commands
2021-04-03 23:30:19 -04:00
James WoglomandGitHub 8ce8b42bfc Update README.md 2021-04-03 23:26:38 -04:00
James WoglomandGitHub c14298384a Update README.md - clarify folder for .env 2021-04-03 23:21:54 -04:00
LegendaryGeekandGitHub 84067015e3 Update README.md to correct the docker run commands 2021-04-03 18:08:20 -04:00
James Woglom 0b7e806a40 check: add --check-login option, which checks that the APIs can be queried 2021-03-22 22:38:07 -04:00
James Woglom 89b40dcecb nightscout: use urljoin so trailing backslash is not required in URL. add api status endpoint 2021-03-22 22:37:32 -04:00
James Woglom 539516aeae api: add API endpoints for checking general status (basaliq, controliq) 2021-03-22 22:37:05 -04:00
James Woglom 332f54e85e api: add some unused api endpoints from reverse engineering 2021-03-22 21:30:57 -04:00
James Woglom 19f4f9363a autoupdate: add custom env options to control update rate
Also updates secret.py to use simpler code for parsing numbers
2021-03-22 01:27:27 -04:00
James Woglom d804510633 .github/workflows: update workflow, add readme badge 2021-03-18 02:17:44 -04:00
James WoglomandGitHub 713d2ee79e Create python-package.yml
Auto-run linter, pytest, and pipenv check
2021-03-18 02:11:54 -04:00
James Woglom e0bfab8759 tests/parser: add start of TConnectEntry test 2021-03-18 02:07:54 -04:00
James Woglom 209292dd21 tests/sync: complete basal ciq process test 2021-03-18 02:07:39 -04:00
James Woglom 1a9fb36b88 refactor: move tconnect and nightscout API parsers into subpackage 2021-03-18 01:53:03 -04:00
James Woglom 2e0120fdfc tests: add first test for basal processing 2021-03-18 01:42:44 -04:00
James Woglom 3911da7d37 refactor: update file links in readme 2021-03-18 01:10:51 -04:00
James Woglom 7cfd486ac5 refactor: move auto-update code to separate file 2021-03-18 01:04:24 -04:00
James Woglom 8c6719c6a6 refactor: fix secret imports, move to pkg folder 2021-03-18 01:04:24 -04:00
James Woglom d00d8e59dd refactor: move process and synchronization code outside of main file
Splits up basal, bolus, and iob parsing code into
separate files in the sync folder. Moves the single-
cycle processing code into process.py
2021-03-18 01:04:24 -04:00
James Woglom 63ca6eda43 refactor: move into a standardized python packaging format
In the current directory structure, py files inside of
a folder cannot import files inside a different folder.
2021-03-18 00:34:28 -04:00
James Woglom 14b5bfea67 api/android: log android api error text v0.1.0 2021-03-16 20:53:19 -04:00
James Woglom 3b0794accc api: use separate exception class for login errors 2021-03-16 20:51:46 -04:00
James WoglomandGitHub 7ec4f96cba Update README.md - quote values in env file 2021-03-16 20:40:15 -04:00
James WoglomandGitHub c2674fcb1b Update README: Add Docker Hub repo 2021-03-15 22:52:00 -04:00
James WoglomandGitHub 6ebb9bb9dd Create publish-docker.yml 2021-03-15 20:50:05 -04:00
James Woglom b7e8dceef1 Add dockerfile and instructions in README 2021-03-15 20:42:13 -04:00
James Woglom e45a850346 secret.py: fix pump serial number validation
Some Tandem pump serial numbers are less than 8 digits.
(I previously had one which was 6 digits.)
2021-03-15 20:15:10 -04:00
James WoglomandGitHub c977e05310 Merge pull request #1 from bewest/wip/bewest/dev
Wip/bewest/dev - 12 factor app
2021-03-15 18:53:00 -04:00
Ben West 0f4cf36de2 12 factor app: environment variables
Use the dotenv library to read both a file called .env, as well as inspect
environment variables.
In addition, provide some checking and sanitization on the PUMP_SERIAL_NUMBER
along with an error message for commonly anticipated issues.
2021-03-14 21:51:33 -07: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
Ben West cc952992e0 12 factor app: prep for reading environment variables
This change prepares the repo to ignore a .env file instead of the secret.py.
It also eliminates the secret.py.example file, which shouldn't be needed.
2021-03-14 21:46:48 -07:00