projects
/
kraftakt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3282265
)
Package gfit: Create the "activity segment" data source.
author
Florian Forster
<ff@octo.it>
Sun, 28 Jan 2018 19:57:57 +0000
(20:57 +0100)
committer
Florian Forster
<ff@octo.it>
Sun, 28 Jan 2018 19:57:57 +0000
(20:57 +0100)
gfit/gfit.go
patch
|
blob
|
history
diff --git
a/gfit/gfit.go
b/gfit/gfit.go
index
227f463
..
657da7d
100644
(file)
--- a/
gfit/gfit.go
+++ b/
gfit/gfit.go
@@
-234,12
+234,22
@@
func (c *Client) SetActivities(ctx context.Context, activities []Activity, start
return nil
}
return nil
}
- dataStreamID := DataStreamID(&fitness.DataSource{
+ dataStreamID, err := c.DataSourceCreate(ctx, &fitness.DataSource{
+ Application: Application(ctx),
DataType: &fitness.DataType{
DataType: &fitness.DataType{
+ Field: []*fitness.DataTypeField{
+ &fitness.DataTypeField{
+ Name: "activity",
+ Format: "integer",
+ },
+ },
Name: dataTypeNameActivitySegment,
},
Type: "raw",
})
Name: dataTypeNameActivitySegment,
},
Type: "raw",
})
+ if err != nil {
+ return err
+ }
endOfDay := startOfDay.Add(24 * time.Hour).Add(-1 * time.Nanosecond)
endOfDay := startOfDay.Add(24 * time.Hour).Add(-1 * time.Nanosecond)