Unofficial dotnet garmin connect client
This package allows you to request your device, activity and health data from your Garmin Connect account.
WARNING! Use the library only for personal automation without too many accounts. For other needs request access to the developer program.
dotnet add package Unofficial.Garmin.Connect
var login = "<garmin login>";
var password = "<garmin password>";
var authParameters = new BasicAuthParameters(login, password);
var client = new GarminConnectClient(new GarminConnectContext(new HttpClient(), authParameters));
var login = "<garmin login>";
var password = "<garmin password>";
var authParameters = new BasicAuthParameters(login, password);
var mfaCode = new StaticMfaCode();
var client = new GarminConnectClient(new GarminConnectContext(new HttpClient(), authParameters, mfaCode));
Example IMfaCodeProvider
implementation
public class StaticMfaCode: IMfaCodeProvider
{
public Task<string> GetMfaCodeAsync()
{
// 1. static code
var code = "123456";
// 2. wait input code from console
// var code = Console.ReadLine().Trim();
// 3. any other approach how to wait and get the code from the user
// like read from file, variable, form input, etc.
return Task.FromResult(code);
}
}
- build
./pack.sh
- pack
./publish.sh
- set environment variables
GARMIN_LOGIN
andGARMIN_PASSWORD
- JetBrains Rider
File | Settings | Build, Execution, Deployment | Unit Testing | Test Runner
- JetBrains Rider
- The first vision from cyberjunky/python-garminconnect
- Icons made by Freepik from www.flaticon.com
- Converter JSON to C# app.quicktype.io
- and Garmin for the best devices