diff --git a/Pipfile b/Pipfile index 358bf59..9368aca 100644 --- a/Pipfile +++ b/Pipfile @@ -7,7 +7,7 @@ verify_ssl = true ptpython = "*" [packages] -tconnectsync = {editable = true, path = "."} +tconnectsync = {path = "."} requests = "*" bs4 = "*" arrow = "*" diff --git a/Pipfile.lock b/Pipfile.lock index e5214f2..f3d86ef 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "413f8bbd66e702656262deda1b6586d42b5a2e9fa52f6d23416b1ea1efbc2591" + "sha256": "84349eb022c87848b29854316de1740d1223d444f06eb9dcbf7df92aa98475e2" }, "pipfile-spec": 6, "requires": {}, @@ -175,16 +175,16 @@ "version": "==2.3.1" }, "tconnectsync": { - "editable": true, - "path": "." + "path": ".", + "version": "==0.6.4" }, "urllib3": { "hashes": [ - "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", - "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" + "sha256:000ca7f471a233c2251c6c7023ee85305721bfdf18621ebff4fd17a8653427ed", + "sha256:0e7c33d9a63e7ddfcb86780aac87befc2fbddf46c58dbb487e0855f7ceec283c" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.7" + "version": "==1.26.8" } }, "develop": { diff --git a/README.md b/README.md index 990051d..1adade0 100644 --- a/README.md +++ b/README.md @@ -21,20 +21,29 @@ When you run the program with no arguments, it performs a single cycle of the fo * Merges the basal information received from the two APIs. (If using ControlIQ, then basal information appears only on the ControlIQ API. If not using ControlIQ, it appears only on the legacy API.) * Queries Nightscout for the most recently created Temp Basal object by tconnectsync, and uploads all data newer than that. * Queries Nightscout for the most recently created Bolus object by tconnectsync, and uploads all data newer than that. -* Uploads a single Nightscout Activity object representing the current IOB as reported by the pump. If run with the `--auto-update` flag, then the application performs the following steps: * Queries an API endpoint used only by the t:connect mobile app which returns an internal event ID, corresponding to the most recent event published by the mobile app. * Whenever the internal event ID changes (denoting that the mobile app uploaded new data to synchronize), perform all of the above mentioned steps to synchronize data. -The following synchronization features are enabled by default: +## What Gets Synced + +Tconnectsync is composed of individual so-called _synchronization features_, which are elements of data that can be +synchronized between t:connect data from the pump and Nightscout. +When setting up tconnectsync, you can choose to configure which synchronization features are enabled and disabled. + +Here are a few examples of reasons why you might want to adjust the enabled synchronization features: + +* If you currently input boluses into Nightscout manually with comments, then you may wish to _disable the `BOLUS` synchronization feature_ so that there are no duplicated boluses in Nightscout. +* If you want to see Sleep and Exercise Mode data appear in Nightscout, then you may with to _enable the `PUMP_EVENTS` synchronization feature_. + +These synchronization features are enabled by default: * `BASAL`: Basal data * `BOLUS`: Bolus data -* `IOB`: Insulin-on-board data. Only the most recent IOB entry is saved to Nightscout, as an "activity" -The following synchronization feature is disabled by default, but can be enabled via the `--features` flag: +The following synchronization features can be optionally enabled: * `PUMP_EVENTS`: Events reported by the pump. Includes support for the following: * Site/Cartridge Change (occurs for both a site change and a cartridge change) @@ -42,6 +51,19 @@ The following synchronization feature is disabled by default, but can be enabled * User Suspended (occurs when you manually disable insulin delivery) * Exercise Mode (in Nightscout, appears with a start and end time) * Sleep Mode (in Nightscout, appears with a start and end time) +* `IOB`: Insulin-on-board data. Only the most recent IOB entry is saved to Nightscout, as an "activity". The Nightscout UI does not currently display this information. In order to read this value, you need to query the Nightscout activity API endpoint. If you don't know what that means, then there is no reason to enable this option. + +The following synchronization features are under development, [**but are not yet ready for use**](https://github.com/jwoglom/tconnectsync/issues/16): +* `BOLUS_BG`: Adds BG readings which are associated with boluses on the pump into the Nightscout treatment object. It will determine whether the BG reading was automatically filled via the Dexcom connection on the pump or was manually entered by seeing if the BG reading matches the current CGM reading as known to the pump at that time. Support for this is nearly complete. +* `CGM`: Adds Dexcom CGM readings from the pump to Nightscout as SGV (sensor glucose value) entries. This should only be used in a situation where xDrip/Dexcom Share/etc. is not used and the pump connection to the CGM will be the only source of CGM data to Nightscout. This requires additional testing before it should be considered ready. + +To specify custom synchronization features, pass the names of the desired features to the `--features` flag, e.g.: + +```bash +$ tconnectsync --features BASAL BOLUS PUMP_EVENTS +``` + +If you're using tconnectsync-heroku, see [this section in its README](https://github.com/jwoglom/tconnectsync-heroku#Updating-synchronization-features). ## Setup diff --git a/tconnectsync/features.py b/tconnectsync/features.py index 9f183e2..12dd794 100644 --- a/tconnectsync/features.py +++ b/tconnectsync/features.py @@ -10,8 +10,7 @@ PUMP_EVENTS = "PUMP_EVENTS" DEFAULT_FEATURES = [ BASAL, - BOLUS, - IOB + BOLUS ] ALL_FEATURES = [