kraftakt.git
6 years agoPackage fitbit: Add the ActivityParentName, LastModified, StartDate fields.
Florian Forster [Wed, 24 Jan 2018 19:31:02 +0000 (20:31 +0100)]
Package fitbit: Add the ActivityParentName, LastModified, StartDate fields.

6 years agoPackage gfit: Check return value of readCumulative() for errors.
Florian Forster [Mon, 22 Jan 2018 21:12:48 +0000 (22:12 +0100)]
Package gfit: Check return value of readCumulative() for errors.

6 years agoPackage gfit: Include the DataStreamName in the DataStreadID.
Florian Forster [Mon, 22 Jan 2018 21:11:13 +0000 (22:11 +0100)]
Package gfit: Include the DataStreamName in the DataStreadID.

6 years agoCall ActivitySummary() and Profile() concurrently.
Florian Forster [Mon, 22 Jan 2018 21:10:28 +0000 (22:10 +0100)]
Call ActivitySummary() and Profile() concurrently.

6 years agoReturn errs only if it contains at least one error.
Florian Forster [Mon, 22 Jan 2018 19:41:06 +0000 (20:41 +0100)]
Return errs only if it contains at least one error.

6 years agoPackage fitbit: ActivitySummery(): Log full response.
Florian Forster [Mon, 22 Jan 2018 08:04:48 +0000 (09:04 +0100)]
Package fitbit: ActivitySummery(): Log full response.

6 years agoPackage app: Check all fields of the OAuth token for equality.
Florian Forster [Mon, 22 Jan 2018 08:01:19 +0000 (09:01 +0100)]
Package app: Check all fields of the OAuth token for equality.

It appears that refresh tokens don't always change. Check the AccessToken
field, too, and the rest of the struct for completeness sake.

6 years agoWrite Google Fit entries concurrently.
Florian Forster [Mon, 22 Jan 2018 07:37:22 +0000 (08:37 +0100)]
Write Google Fit entries concurrently.

6 years agoPackage app: Add mutex to persistingTokenSource.
Florian Forster [Mon, 22 Jan 2018 07:34:51 +0000 (08:34 +0100)]
Package app: Add mutex to persistingTokenSource.

6 years agoImplement distance conversion.
Florian Forster [Tue, 16 Jan 2018 21:37:42 +0000 (22:37 +0100)]
Implement distance conversion.

6 years agoFixup: Pass RestingHeartRate to SetHeartRate().
Florian Forster [Tue, 16 Jan 2018 21:37:01 +0000 (22:37 +0100)]
Fixup: Pass RestingHeartRate to SetHeartRate().

6 years agoPackage gfit: Calculate "average" heart rate.
Florian Forster [Tue, 16 Jan 2018 21:35:29 +0000 (22:35 +0100)]
Package gfit: Calculate "average" heart rate.

JSON does not support NaN data points.

6 years agoPackage fitbit: Don't URL-decode Fitbit's signature.
Florian Forster [Tue, 16 Jan 2018 19:24:49 +0000 (20:24 +0100)]
Package fitbit: Don't URL-decode Fitbit's signature.

The documentation states that that should be done, but then the signature
may include "+", which URL decode turns into a space …

6 years agoImplement mapping of heart rate zones.
Florian Forster [Tue, 16 Jan 2018 16:14:58 +0000 (17:14 +0100)]
Implement mapping of heart rate zones.

6 years agoRebrand as "Kraftakt".
Florian Forster [Tue, 16 Jan 2018 16:11:39 +0000 (17:11 +0100)]
Rebrand as "Kraftakt".

6 years agoRefactor writing of step values via the generic methods.
Florian Forster [Mon, 15 Jan 2018 09:02:19 +0000 (10:02 +0100)]
Refactor writing of step values via the generic methods.

6 years agoImplement storing of calories expended.
Florian Forster [Mon, 15 Jan 2018 08:55:42 +0000 (09:55 +0100)]
Implement storing of calories expended.

6 years agoPackage gfit: Steps: Calculate diff to previously stored data point.
Florian Forster [Sat, 13 Jan 2018 21:35:12 +0000 (22:35 +0100)]
Package gfit: Steps: Calculate diff to previously stored data point.

Google Fit will happily store multiple data points with the exact same
dataSourceID and start and end times. The web frontend then seems to
discard duplicate entries.

This commit reads existing data points and then calculates the
difference to the existing entries.

6 years agoPackage fitbit: Implement the Profile() method.
Florian Forster [Fri, 12 Jan 2018 12:57:54 +0000 (13:57 +0100)]
Package fitbit: Implement the Profile() method.

6 years agoPackage gfit: API fixes.
Florian Forster [Fri, 12 Jan 2018 09:53:45 +0000 (10:53 +0100)]
Package gfit: API fixes.

* Add calculation of DataStreamID().
* Don't treat http.StatusConflict as an error when creating DataSources.

6 years agoWrite step count summary to Google Fit.
Florian Forster [Thu, 11 Jan 2018 20:45:43 +0000 (21:45 +0100)]
Write step count summary to Google Fit.

6 years agoPackage gfit: Implement initial client code for Google Fit.
Florian Forster [Thu, 11 Jan 2018 12:19:56 +0000 (13:19 +0100)]
Package gfit: Implement initial client code for Google Fit.

6 years agoPackage app: Wrap oauth2.TokenSource to ensure datastore is always updated.
Florian Forster [Thu, 11 Jan 2018 11:56:30 +0000 (12:56 +0100)]
Package app: Wrap oauth2.TokenSource to ensure datastore is always updated.

6 years agoPackage fitbit: Update RefreshToken in Datastore after refreshing OAuth token.
Florian Forster [Thu, 11 Jan 2018 07:39:16 +0000 (08:39 +0100)]
Package fitbit: Update RefreshToken in Datastore after refreshing OAuth token.

6 years agoPackage fitbit: Fix activity summary URL.
Florian Forster [Wed, 10 Jan 2018 21:06:55 +0000 (22:06 +0100)]
Package fitbit: Fix activity summary URL.

6 years agoSmall cleanup.
Florian Forster [Wed, 10 Jan 2018 21:03:15 +0000 (22:03 +0100)]
Small cleanup.

6 years agoPackage app: Add email address to User object.
Florian Forster [Wed, 10 Jan 2018 21:02:50 +0000 (22:02 +0100)]
Package app: Add email address to User object.

6 years agoMove more logic into the "fitbit" and (new) "app" packages.
Florian Forster [Wed, 10 Jan 2018 20:48:25 +0000 (21:48 +0100)]
Move more logic into the "fitbit" and (new) "app" packages.

6 years agoMore trial-and-error fixes.
Florian Forster [Wed, 10 Jan 2018 19:15:43 +0000 (20:15 +0100)]
More trial-and-error fixes.

* datastore.Key.Encode is too long for a subscriber ID, which appears
  limited to 50 characters / bytes.
* Use UUID as subscriber ID.
* Rename fitbitNotification to fitbitSubscription.
* Implement parsing of the "activity summary" in a separate package.

6 years agoImprove user visible status.
Florian Forster [Wed, 10 Jan 2018 13:53:14 +0000 (14:53 +0100)]
Improve user visible status.

6 years agoCheck status code when calling the subscription API.
Florian Forster [Wed, 10 Jan 2018 13:52:33 +0000 (14:52 +0100)]
Check status code when calling the subscription API.

6 years agoRemove query string when redirecting user.
Florian Forster [Wed, 10 Jan 2018 13:52:15 +0000 (14:52 +0100)]
Remove query string when redirecting user.

6 years agoInitial commit.
Florian Forster [Wed, 10 Jan 2018 10:33:54 +0000 (11:33 +0100)]
Initial commit.