-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgoogle_datasources.py
198 lines (194 loc) · 5.78 KB
/
google_datasources.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
'''This file stores templates for all the different Google Fit DataSources
Each type of data uploaded to Google Fit requires a matching datasource,
if iFit will open their API it should be possible to get the treadmill make and model
and replace the fixed ones here, you can change the make and model here manually until
that is done'''
import json
with open("credentials.json") as credentials:
credentials = json.load(credentials)
ProjectNumber = credentials.get("installed").get("client_id").split("-")[0]
GOOGLE_DATA_SOURCES = [
{
"datasourceid": "raw:com.google.heart_rate.bpm:"
+ ProjectNumber
+ ":NordicTrack:IFHRM214:100001",
"type": "raw",
"application": {"name": "ifitsync"},
"dataType": {
"name": "com.google.heart_rate.bpm",
"field": [{"format": "floatPoint", "name": "bpm"}],
},
"device": {
"type": "chestStrap",
"manufacturer": "NordicTrack",
"model": "IFHRM214",
"uid": "100001",
"version": "1.0",
},
},
{
"datasourceid": "raw:com.google.speed:"
+ ProjectNumber
+ ":NordicTrack:Commercial2950:100001",
"type": "raw",
"application": {"name": "ifitsync"},
"dataType": {
"name": "com.google.speed",
"field": [{"format": "floatPoint", "name": "speed"}],
},
"device": {
"type": "unknown",
"manufacturer": "NordicTrack",
"model": "Commercial2950",
"uid": "100001",
"version": "1.0",
},
},
{
"datasourceid": "raw:com.google.power.sample:"
+ ProjectNumber
+ ":NordicTrack:Commercial2950:100001",
"type": "raw",
"application": {"name": "ifitsync"},
"dataType": {
"name": "com.google.power.sample",
"field": [{"format": "floatPoint", "name": "watts"}],
},
"device": {
"type": "unknown",
"manufacturer": "NordicTrack",
"model": "Commercial2950",
"uid": "100001",
"version": "1.0",
},
},
{
"datasourceid": "raw:com.google.calories.expended:"
+ ProjectNumber
+ ":NordicTrack:Commercial2950:100001",
"type": "raw",
"application": {"name": "ifitsync"},
"dataType": {
"name": "com.google.calories.expended",
"field": [{"format": "floatPoint", "name": "calories"}],
},
"device": {
"type": "unknown",
"manufacturer": "NordicTrack",
"model": "Commercial2950",
"uid": "100001",
"version": "1.0",
},
},
{
"datasourceid": "raw:com.google.distance.delta:"
+ ProjectNumber
+ ":NordicTrack:Commercial2950:100001",
"type": "raw",
"application": {"name": "ifitsync"},
"dataType": {
"name": "com.google.distance.delta",
"field": [{"format": "floatPoint", "name": "distance"}],
},
"device": {
"type": "unknown",
"manufacturer": "NordicTrack",
"model": "Commercial2950",
"uid": "100001",
"version": "1.0",
},
},
{
"datasourceid": "raw:com.google.step_count.delta:"
+ ProjectNumber
+ ":NordicTrack:Commercial2950:100001",
"type": "raw",
"application": {"name": "ifitsync"},
"dataType": {
"name": "com.google.step_count.delta",
"field": [{"format": "integer", "name": "steps"}],
},
"device": {
"type": "unknown",
"manufacturer": "NordicTrack",
"model": "Commercial2950",
"uid": "100001",
"version": "1.0",
},
},
{
"datasourceid": "raw:com.google.activity.segment:"
+ ProjectNumber
+ ":NordicTrack:Commercial2950:100001",
"type": "raw",
"application": {"name": "ifitsync"},
"dataType": {
"name": "com.google.activity.segment",
"field": [{"format": "integer", "name": "activity"}],
},
"device": {
"type": "unknown",
"manufacturer": "NordicTrack",
"model": "Commercial2950",
"uid": "100001",
"version": "1.0",
},
},
{
"datasourceid": "raw:com.google.location.sample:"
+ ProjectNumber
+ ":NordicTrack:Commercial2950:100001",
"type": "raw",
"application": {"name": "ifitsync"},
"dataType": {"name": "com.google.location.sample"},
"device": {
"type": "unknown",
"manufacturer": "NordicTrack",
"model": "Commercial2950",
"uid": "100001",
"version": "1.0",
},
},
{
"datasourceid": "raw:com.ifitsync.treadmillincline.degrees:"
+ ProjectNumber
+ ":TreadmillIncline",
"dataStreamName": "TreadmillIncline",
"type": "raw",
"application": {
"detailsUrl": "https://github.com/omriasta/ifitsync",
"name": "Treadmill Incline Degrees",
"version": "1"
},
"dataType": {
"name": "com.ifitsync.treadmillincline.degrees",
"field": [
{
"name": "treadmill_incline_degrees",
"format": "floatPoint"
}
]
}
},
{
"datasourceid": "raw:com.ifitsync.treadmill.elevation:"
+ ProjectNumber
+ ":TreadmillElevation",
"dataStreamName": "TreadmillElevation",
"type": "raw",
"application": {
"detailsUrl": "https://github.com/omriasta/ifitsync",
"name": "Treadmill Elevation Meters",
"version": "1"
},
"dataType": {
"name": "com.ifitsync.treadmill.elevation",
"field": [
{
"name": "treadmill_elevation_meters",
"format": "floatPoint"
}
]
}
}
]