Skip to content

Commit 82f1c24

Browse files
authored
✨ define deployment-level overrides on native configs: tracking, sync (#166)
Some behaviors of the native code are configurable via the "tracking" config and "sync" config. Defaults are set in the native code (i.e. app level) and users can edit in Profile > Developer Zone, but up to now they have not been set at the deployment level. For the fleet version of OpenPATH, we did add support for one deployment-level config option under "tracking" ("bluetooth_only" which mapped to "isFleet" in the native code) but it was handled separately from other options. We are reworking the native code so that *any* fields defined in "tracking" or "sync" override the built-in default values when that config is constructed. This brings the deployment config spec in line with the native code spec and should simplify the config logic in the process.
1 parent d3ee680 commit 82f1c24

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

configs/dfc-fermata.nrel-op.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"url_abbreviation": "dfc-fermata",
3-
"version": 9,
3+
"version": 10,
44
"ts": 1707714796,
55
"server": {
66
"connectUrl": "https://dfc-fermata-openpath.nrel.gov/api/",
@@ -443,7 +443,7 @@
443443
}
444444
],
445445
"tracking": {
446-
"bluetooth_only": true
446+
"is_fleet": true
447447
},
448448
"display_config": {
449449
"use_imperial": true

configs/walk-study-psu.nrel-op.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"url_abbreviation": "walk-study-psu",
3-
"version": 3,
3+
"version": 4,
44
"ts": 1741122104,
55
"server": {
66
"connectUrl": "https://walk-study-psu-openpath.nrel.gov/api/",
@@ -62,6 +62,9 @@
6262
},
6363
"trip-labels": "ENKETO"
6464
},
65+
"tracking": {
66+
"filter_distance": -1
67+
},
6568
"display_config": {
6669
"use_imperial": true
6770
},

index.d.ts

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ export type DeploymentConfig = {
1515
label_options?: `https://${string}`;
1616
vehicle_identities?: VehicleIdentity[];
1717
reminderSchemes?: ReminderSchemesConfig;
18-
tracking?: {
19-
bluetooth_only: boolean;
20-
};
18+
tracking?: Partial<TrackingConfig>;
19+
sync?: Partial<SyncConfig>;
2120
display_config: {
2221
use_imperial: boolean;
2322
};
@@ -117,6 +116,27 @@ export type ReminderSchemesConfig = {
117116
};
118117
};
119118

119+
// corresponds to LocationTrackingConfig in e-mission-data-collection
120+
export type TrackingConfig = {
121+
is_duty_cycling: boolean;
122+
simulate_user_interaction: boolean;
123+
accuracy: number;
124+
accuracy_threshold: number;
125+
filter_distance: number;
126+
filter_time: number;
127+
geofence_radius: number;
128+
ios_use_visit_notifications_for_detection: boolean;
129+
ios_use_remote_push_for_sync: boolean;
130+
android_geofence_responsiveness: number;
131+
is_fleet: boolean;
132+
};
133+
134+
// corresponds to ServerSyncConfig in cordova-server-sync
135+
export type SyncConfig = {
136+
sync_interval: number; // seconds
137+
ios_use_remote_push: boolean;
138+
};
139+
120140
// the available metrics that can be displayed in the phone dashboard
121141
export type MetricName =
122142
| "distance"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"name": "nrel-openpath-deploy-configs",
3-
"version": "1.0.0"
3+
"version": "1.0.1"
44
}

0 commit comments

Comments
 (0)