Skip to content

Commit

Permalink
Merge pull request #164 from jaroslawhartman/feat/161-Errors-message-…
Browse files Browse the repository at this point in the history
…not-correct-when-garmin-username-is-set

#161: Errors message not correct when garmin username is set, but no data should be synced
  • Loading branch information
longstone authored Jun 18, 2024
2 parents cbd0524 + ff2c838 commit 9ea0c8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion withings_sync/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9ea0c8b

Please sign in to comment.