diff --git a/README.md b/README.md index bd0ed21..f5b28e1 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,9 @@ You should specify the following parameters: TCONNECT_EMAIL='email@email.com' TCONNECT_PASSWORD='password' +# OPTIONAL: Your region (US or EU) +TCONNECT_REGION=US + # URL of your Nightscout site NS_URL='https://yournightscouturl/' # Your Nightscout API_SECRET value @@ -99,6 +102,7 @@ TIMEZONE_NAME='America/New_York' # OPTIONAL: Your pump's serial number (numeric) PUMP_SERIAL_NUMBER=11111111 + ``` This file contains your t:connect username and password, Tandem pump serial number (which is utilized in API calls to t:connect), your Nightscout URL and secret token (for uploading data to Nightscout), and local timezone (the timezone used in t:connect). When specifying the timezone, enter a [TZ database name value](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). diff --git a/setup.cfg b/setup.cfg index 6a169a5..204b1a5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = tconnectsync -version = 2.2.4 +version = 2.3.0 author = James Woglom author_email = j@wogloms.net description = Syncs Tandem Source (formerly t:connect) insulin pump data to Nightscout for the t:slim X2 diff --git a/tconnectsync/check.py b/tconnectsync/check.py index 13dc2f4..2b81a4e 100644 --- a/tconnectsync/check.py +++ b/tconnectsync/check.py @@ -53,12 +53,14 @@ def check_login(tconnect, time_start, time_end, verbose=False, sanitize=True): log("Loading secrets...") try: - from .secret import TCONNECT_EMAIL, TCONNECT_PASSWORD, PUMP_SERIAL_NUMBER, NS_URL, NS_SECRET, TIMEZONE_NAME + from .secret import TCONNECT_EMAIL, TCONNECT_PASSWORD, TCONNECT_REGION, PUMP_SERIAL_NUMBER, NS_URL, NS_SECRET, TIMEZONE_NAME from . import secret except ImportError as e: log("Error: Unable to load config file. Please check your .env file or environment variables") log_err(e) + log(f"Using {TCONNECT_REGION=}") + if not TCONNECT_EMAIL or TCONNECT_EMAIL == 'email@email.com': log("Error: You have not specified a TCONNECT_EMAIL") errors += 1