From ff2c838867e9a32679b1ea28e64182252f4d55e0 Mon Sep 17 00:00:00 2001 From: longstone <3483450-longstone@users.noreply.gitlab.com> Date: Wed, 24 Jan 2024 11:24:16 +0100 Subject: [PATCH] #161: Errors message not correct when garmin username is set, but no data should be synced --- withings_sync/sync.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/withings_sync/sync.py b/withings_sync/sync.py index dca4363..e874d00 100644 --- a/withings_sync/sync.py +++ b/withings_sync/sync.py @@ -297,6 +297,9 @@ def prepare_syncdata(height, groups): collected_metrics = "weight data" if "BLOOD_PRESSURE" in ARGS.features: collected_metrics += " or blood pressure" + elif "diastolic_blood_pressure" in group_data: + collected_metrics += ", but blood pressure (to enable sync set --features BLOOD_PRESSURE)" + logging.info( "%s This Withings metric contains no %s. Not syncing...", dt, collected_metrics @@ -478,8 +481,10 @@ def sync(): # Save this sync so we don't re-download the same data again (if no range has been specified) if not ARGS.fromdate: withings.set_lastsync() - else: + elif ARGS.garmin_username is None: logging.info("No Garmin username - skipping sync") + else: + logging.info("No Garmin data selected - skipping sync") else: logging.info("Skipping upload") return 0