-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some weights measurements discarded incorrectly #175
Comments
Could you please provide an anonymized log? |
Here's an example log obtained with latest (.venv)$ python3 --version
(.venv)$ pip list | grep withings
withings-sync 4.2.7
(.venv)$ withings-sync -f 2024-11-30 -v
2024-11-30 22:09:32,378 - root - DEBUG - withings-sync script version 4.2.7
2024-11-30 22:09:32,378 - root - DEBUG - Script invoked with the following arguments: Namespace(garmin_username='', garmin_password='', trainerroad_username='', trainerroad_password='', fromdate=datetime.datetime(2024, 11, 30, 0, 0), todate=datetime.date(2024, 11, 30), to_fit=False, to_json=False, output=None, no_upload=False, features=[], verbose=True)
2024-11-30 22:09:32,378 - withings - INFO - Refresh Access Token
2024-11-30 22:09:32,383 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-11-30 22:09:32,631 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /v2/oauth2 HTTP/11" 200 220
2024-11-30 22:09:32,636 - root - INFO - Fetching measurements from 2024-11-30 00:00 to 2024-11-30 23:59
2024-11-30 22:09:32,636 - withings - DEBUG - Get Height
2024-11-30 22:09:32,637 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-11-30 22:09:32,968 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/11" 200 371
2024-11-30 22:09:32,969 - withings - DEBUG - Height received
2024-11-30 22:09:32,972 - withings - INFO - Get Measurements
2024-11-30 22:09:32,974 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-11-30 22:09:33,219 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/11" 200 1454
2024-11-30 22:09:33,220 - withings - DEBUG - Measurements received
2024-11-30 22:09:33,224 - root - DEBUG - 2024-11-30 09:20:17 Detected data:
2024-11-30 22:09:33,224 - root - DEBUG - Weight: 67.57700299999999 kg
2024-11-30 22:09:33,225 - root - DEBUG - Fat Free Mass: ??.??? kg
2024-11-30 22:09:33,225 - root - DEBUG - Fat Ratio: ??.??? %
2024-11-30 22:09:33,225 - root - DEBUG - Fat Mass Weight: ??.??? kg
2024-11-30 22:09:33,225 - root - DEBUG - Muscle Mass: ??.??? kg
2024-11-30 22:09:33,225 - root - DEBUG - Hydration: ??.??? kg
2024-11-30 22:09:33,225 - root - DEBUG - Bone Mass: ??.??? kg
2024-11-30 22:09:33,225 - root - DEBUG - Extracellular Water: ?? kg
2024-11-30 22:09:33,225 - root - DEBUG - unknown: ????
2024-11-30 22:09:33,225 - root - DEBUG - unknown: ????
2024-11-30 22:09:33,225 - root - DEBUG - Record: 2024-11-30 09:20:17, type=weight
height=?.?? m, weight=??.??? kg, fat_ratio=?.??? %, muscle_mass=??.??? kg, percent_hydration=??.??? %, bone_mass=??.??? kg, bmi=??.???
2024-11-30 22:09:33,225 - root - INFO - 2024-11-30 09:20:17 This Withings metric contains no weight data. Not syncing...
2024-11-30 22:09:33,225 - root - DEBUG - Heart Pulse: ?? bpm
2024-11-30 22:09:33,226 - root - ERROR - Invalid or no data detected
2024-11-30 22:09:33,226 - root - DEBUG - Generating fit data...
2024-11-30 22:09:33,226 - root - INFO - No weight data to sync for FIT file
2024-11-30 22:09:33,226 - root - INFO - No blood pressure data to sync for FIT file
2024-11-30 22:09:33,226 - root - DEBUG - Fit data generated...
2024-11-30 22:09:33,226 - root - DEBUG - Generating json data...
2024-11-30 22:09:33,226 - root - DEBUG - Json data generated...
2024-11-30 22:09:33,226 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
2024-11-30 22:09:33,226 - root - INFO - No Garmin data selected - skipping sync Note for example Here's the log with the code patched as mentioned in my previous comment: (.venv)$ withings-sync -f 2024-11-30 -v
2024-11-30 22:10:06,723 - root - DEBUG - withings-sync script version 4.2.7
2024-11-30 22:10:06,723 - root - DEBUG - Script invoked with the following arguments: Namespace(garmin_username='', garmin_password='', trainerroad_username='', trainerroad_password='', fromdate=datetime.datetime(2024, 11, 30, 0, 0), todate=datetime.date(2024, 11, 30), to_fit=False, to_json=False, output=None, no_upload=False, features=[], verbose=True)
2024-11-30 22:10:06,723 - withings - INFO - Refresh Access Token
2024-11-30 22:10:06,727 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-11-30 22:10:06,975 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /v2/oauth2 HTTP/11" 200 220
2024-11-30 22:10:06,979 - root - INFO - Fetching measurements from 2024-11-30 00:00 to 2024-11-30 23:59
2024-11-30 22:10:06,979 - withings - DEBUG - Get Height
2024-11-30 22:10:06,981 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-11-30 22:10:07,272 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/11" 200 371
2024-11-30 22:10:07,273 - withings - DEBUG - Height received
2024-11-30 22:10:07,275 - withings - INFO - Get Measurements
2024-11-30 22:10:07,277 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-11-30 22:10:07,505 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/11" 200 1454
2024-11-30 22:10:07,506 - withings - DEBUG - Measurements received
2024-11-30 22:10:07,508 - root - DEBUG - 2024-11-30 09:20:17 Detected data:
2024-11-30 22:10:07,509 - root - DEBUG - Weight: 67.57700299999999 kg
2024-11-30 22:10:07,509 - root - DEBUG - Fat Free Mass: ??.??? kg
2024-11-30 22:10:07,509 - root - DEBUG - Fat Ratio: ??.??? %
2024-11-30 22:10:07,509 - root - DEBUG - Fat Mass Weight: ??.??? kg
2024-11-30 22:10:07,509 - root - DEBUG - Muscle Mass: ??.??? kg
2024-11-30 22:10:07,509 - root - DEBUG - Hydration: ??.??? kg
2024-11-30 22:10:07,509 - root - DEBUG - Bone Mass: ??.??? kg
2024-11-30 22:10:07,509 - root - DEBUG - Extracellular Water: ?? kg
2024-11-30 22:10:07,509 - root - DEBUG - unknown: ????
2024-11-30 22:10:07,509 - root - DEBUG - unknown: ????
2024-11-30 22:10:07,509 - root - DEBUG - Record: 2024-11-30 09:20:17, type=weight
height=?.?? m, weight=??.??? kg, fat_ratio=?.??? %, muscle_mass=??.??? kg, percent_hydration=??.??? %, bone_mass=??.??? kg, bmi=??.???
2024-11-30 22:10:07,509 - root - INFO - 2024-11-30 09:20:17 This Withings metric contains no weight data. Not syncing...
2024-11-30 22:10:07,509 - root - DEBUG - Heart Pulse: ?? bpm
2024-11-30 22:10:07,509 - root - DEBUG - Processed data:
2024-11-30 22:10:07,509 - root - DEBUG - date_time=2024-11-30 09:20:17
2024-11-30 22:10:07,509 - root - DEBUG - height=?.??
2024-11-30 22:10:07,509 - root - DEBUG - weight=??.???
2024-11-30 22:10:07,509 - root - DEBUG - fat_ratio=??.???
2024-11-30 22:10:07,509 - root - DEBUG - muscle_mass=??.???
2024-11-30 22:10:07,509 - root - DEBUG - hydration=??.???
2024-11-30 22:10:07,509 - root - DEBUG - percent_hydration=??.???
2024-11-30 22:10:07,509 - root - DEBUG - bone_mass=??.???
2024-11-30 22:10:07,509 - root - DEBUG - pulse_wave_velocity=None
2024-11-30 22:10:07,509 - root - DEBUG - heart_pulse=None
2024-11-30 22:10:07,509 - root - DEBUG - bmi=??.???
2024-11-30 22:10:07,509 - root - DEBUG - raw_data=[<withings_sync.withings2.WithingsMeasure object at 0x1034679d0>, <withings_sync.withings2.WithingsMeasure object at 0x103467750>, <withings_sync.withings2.WithingsMeasure object at 0x103599220>, <withings_sync.withings2.WithingsMeasure object at 0x103598e90>, <withings_sync.withings2.WithingsMeasure object at 0x10344a7b0>, <withings_sync.withings2.WithingsMeasure object at 0x1033b7130>, <withings_sync.withings2.WithingsMeasure object at 0x1033b7ac0>, <withings_sync.withings2.WithingsMeasure object at 0x10352a050>, <withings_sync.withings2.WithingsMeasure object at 0x10352a250>, <withings_sync.withings2.WithingsMeasure object at 0x1034c8f50>]
2024-11-30 22:10:07,510 - root - DEBUG - type=weight
2024-11-30 22:10:07,510 - root - DEBUG - last_dt: 2024-11-30 09:20:17 last_weight: None
2024-11-30 22:10:07,510 - root - DEBUG - Generating fit data...
2024-11-30 22:10:07,510 - root - INFO - No blood pressure data to sync for FIT file
2024-11-30 22:10:07,510 - root - DEBUG - Fit data generated...
2024-11-30 22:10:07,510 - root - DEBUG - Generating json data...
2024-11-30 22:10:07,510 - root - DEBUG - Json data generated...
2024-11-30 22:10:07,510 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
2024-11-30 22:10:07,510 - root - INFO - No Garmin data selected - skipping sync The weight measurement is in this case not removed. |
Hello, this line of code:
withings-sync/withings_sync/sync.py
Line 309 in 630a7c5
incorrectly deletes all entries that may have already been stored in
sync_dict[dt]
in previous iterations of the loop.I've looked around briefly but simply removing the line seems the proper fix, and it solves my problem of some weights measurements gone missing.
Thanks!
The text was updated successfully, but these errors were encountered: