mirror of
https://github.com/bckelley/tconnectsync.git
synced 2026-08-28 05:34:10 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07e5761178 | ||
|
|
631d1c7b89 | ||
|
|
0253956377 | ||
|
|
59816225e0 | ||
|
|
be113e9cf7 |
@@ -215,9 +215,11 @@ $ docker run tconnectsync --help
|
||||
|
||||
Move the `.env` file you created earlier into this folder, and run:
|
||||
```
|
||||
$ docker run tconnectsync --check-login
|
||||
$ docker run --env-file=.env tconnectsync --check-login
|
||||
```
|
||||
|
||||
**NOTE:** If using the `--env-file` option to `docker run`, you may need to remove all quotation marks (`'` and `"`s) around values in the `.env` file for Docker to propagate the variables correctly.
|
||||
|
||||
If you receive no errors, then you can move on to the **Running Tconnectsync Continuously** section.
|
||||
|
||||
## Running Tconnectsync Continuously
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = tconnectsync
|
||||
version = 0.6.2
|
||||
version = 0.6.3
|
||||
author = James Woglom
|
||||
author_email = j@wogloms.net
|
||||
description = Syncs Tandem t:connect pump data to Nightscout for the t:slim X2
|
||||
|
||||
@@ -30,7 +30,7 @@ except Exception:
|
||||
__version__ = "UNKNOWN"
|
||||
|
||||
def parse_args(*args, **kwargs):
|
||||
parser = argparse.ArgumentParser(description="Syncs bolus, basal, and IOB data from Tandem Diabetes t:connect to Nightscout.")
|
||||
parser = argparse.ArgumentParser(description="Syncs bolus, basal, and IOB data from Tandem Diabetes t:connect to Nightscout.", epilog="Version %s" % __version__)
|
||||
parser.add_argument('--version', action='version', version='tconnectsync %s' % __version__)
|
||||
parser.add_argument('--pretend', dest='pretend', action='store_const', const=True, default=False, help='Pretend mode: do not upload any data to Nightscout.')
|
||||
parser.add_argument('-v', '--verbose', dest='verbose', action='store_const', const=True, default=False, help='Verbose mode: show extra logging details')
|
||||
|
||||
@@ -157,7 +157,10 @@ class TConnectEntry:
|
||||
"alarm": "Empty Cartridge/Pump Shutdown",
|
||||
|
||||
# manual corresponds to a Pumping Suspended by User event
|
||||
"manual": "User Suspended"
|
||||
"manual": "User Suspended",
|
||||
|
||||
# temp-profile corresponds to a Basal Rate Change event to 0u/hr
|
||||
"temp-profile": "Basal Rate Change"
|
||||
}
|
||||
|
||||
BASALSUSPENSION_SKIPPED_EVENTS = {
|
||||
|
||||
@@ -594,6 +594,18 @@ class TestTConnectEntryBasalSuspensionEvent(unittest.TestCase):
|
||||
}
|
||||
)
|
||||
|
||||
def test_parse_basalsuspension_event_tempprofile(self):
|
||||
self.assertEqual(
|
||||
TConnectEntry.parse_basalsuspension_event({
|
||||
'EventDateTime': '/Date(1640541521000-0000)/',
|
||||
'SuspendReason': 'temp-profile'
|
||||
}),
|
||||
{
|
||||
"time": "2021-12-26 09:58:41-05:00",
|
||||
"event_type": "Basal Rate Change"
|
||||
}
|
||||
)
|
||||
|
||||
def test_parse_basalsuspension_event_basalprofile_skipped(self):
|
||||
self.assertIsNone(
|
||||
TConnectEntry.parse_basalsuspension_event({
|
||||
|
||||
@@ -21,6 +21,13 @@ def chdir(dir):
|
||||
class TestSecretDotEnv(unittest.TestCase):
|
||||
maxDiff = None
|
||||
|
||||
def setUp(self):
|
||||
if 'TCONNECT_EMAIL' in os.environ:
|
||||
del os.environ['TCONNECT_EMAIL']
|
||||
|
||||
if 'NS_URL' in os.environ:
|
||||
del os.environ['NS_URL']
|
||||
|
||||
def write_test_dotenv_file(self, path, type):
|
||||
with open(os.path.join(path, ".env"), "w") as f:
|
||||
f.write("""
|
||||
|
||||
Reference in New Issue
Block a user