1.4 KiB
1.4 KiB
Save Garmin Credentials Script
This script mimics the web UI call when hitting "Save Garmin Credentials". It loads Garmin credentials from a .env file and sends them to the backend API.
Usage
-
Create a
.envfile based on the.env.exampletemplate:cp .env.example .env -
Update the
.envfile with your actual Garmin credentials:nano .env -
Run the script:
python save_garmin_creds.py
Prerequisites
- Make sure the backend service is running on the specified host and port (default: localhost:8000)
- Ensure the required dependencies are installed (they should be in the main project requirements.txt)
Expected Response
Upon successful authentication, you'll see a response like:
Response: {
"status": "success",
"message": "Garmin credentials saved and authenticated successfully"
}
If MFA is required:
Response: {
"status": "mfa_required",
"message": "Multi-factor authentication required",
"session_id": "some_session_id"
}
Environment Variables
GARMIN_USERNAME(required): Your Garmin Connect usernameGARMIN_PASSWORD(required): Your Garmin Connect passwordGARMIN_IS_CHINA(optional): Set to 'true' if you're using Garmin China (default: false)BACKEND_HOST(optional): Backend host (default: localhost)BACKEND_PORT(optional): Backend port (default: 8000)