Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit f5c7cee

Browse files
committed
Add VirtualRide, correct EBikeRide ids
1 parent bb4ed41 commit f5c7cee

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

activities.go

+11-7
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ var ActivityTypes = struct {
9292
Kitesurf ActivityType
9393
Windsurf ActivityType
9494
Swim ActivityType
95+
VirtualRide ActivityType
96+
EBikeRide ActivityType
9597

9698
WaterSport ActivityType
9799
Canoeing ActivityType
@@ -107,13 +109,11 @@ var ActivityTypes = struct {
107109
Yoga ActivityType
108110
WinterSport ActivityType
109111
CrossCountrySkiing ActivityType
110-
EBikeRide ActivityType
111112
}{"Ride", "AlpineSki", "BackcountrySki", "Hike", "IceSkate", "InlineSkate", "NordicSki", "RollerSki",
112-
"Run", "Walk", "Workout", "Snowboard", "Snowshoe", "Kitesurf", "Windsurf", "Swim",
113+
"Run", "Walk", "Workout", "Snowboard", "Snowshoe", "Kitesurf", "Windsurf", "Swim", "VirtualRide", "EBikeRide",
113114

114115
"WaterSport", "Canoeing", "Kayaking", "Rowing", "StandUpPaddling", "Surfing",
115116
"Crossfit", "Elliptical", "RockClimbing", "StairStepper", "WeightTraining", "Yoga", "WinterSport", "CrossCountrySkiing",
116-
"EBikeRide",
117117
}
118118

119119
type Location [2]float64
@@ -428,6 +428,10 @@ func (t ActivityType) Id() int {
428428
return 15
429429
case ActivityTypes.Swim:
430430
return 16
431+
case ActivityTypes.VirtualRide:
432+
return 17
433+
case ActivityTypes.EBikeRide:
434+
return 18
431435
case ActivityTypes.WaterSport:
432436
return 20
433437
case ActivityTypes.Canoeing:
@@ -456,8 +460,6 @@ func (t ActivityType) Id() int {
456460
return 40
457461
case ActivityTypes.CrossCountrySkiing:
458462
return 41
459-
case ActivityTypes.EBikeRide:
460-
return 42
461463
}
462464

463465
return 0
@@ -467,8 +469,6 @@ func (t ActivityType) String() string {
467469
switch t {
468470
case ActivityTypes.Ride:
469471
return "Ride"
470-
case ActivityTypes.EBikeRide:
471-
return "EBikeRide"
472472
case ActivityTypes.AlpineSki:
473473
return "Alpine Ski"
474474
case ActivityTypes.BackcountrySki:
@@ -499,6 +499,10 @@ func (t ActivityType) String() string {
499499
return "Windsurf"
500500
case ActivityTypes.Swim:
501501
return "Swim"
502+
case ActivityTypes.VirtualRide:
503+
return "VirtualRide"
504+
case ActivityTypes.EBikeRide:
505+
return "EBikeRide"
502506
case ActivityTypes.WaterSport:
503507
return "WaterSport"
504508
case ActivityTypes.Canoeing:

activities_test.go

+15-8
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,21 @@ func TestActivityType(t *testing.T) {
691691
if s := ActivityTypes.Swim.String(); s != "Swim" {
692692
t.Errorf("activity type string incorrect, got %v", s)
693693
}
694+
if id := ActivityTypes.VirtualRide.Id(); id != 17 {
695+
t.Errorf("activity type id incorrect, got %v", id)
696+
}
697+
698+
if s := ActivityTypes.VirtualRide.String(); s != "VirtualRide" {
699+
t.Errorf("activity type string incorrect, got %v", s)
700+
}
701+
702+
if id := ActivityTypes.EBikeRide.Id(); id != 18 {
703+
t.Errorf("activity type id incorrect, got %v", id)
704+
}
705+
706+
if s := ActivityTypes.EBikeRide.String(); s != "EBikeRide" {
707+
t.Errorf("activity type string incorrect, got %v", s)
708+
}
694709

695710
if id := ActivityTypes.WaterSport.Id(); id != 20 {
696711
t.Errorf("activity type id incorrect, got %v", id)
@@ -804,14 +819,6 @@ func TestActivityType(t *testing.T) {
804819
t.Errorf("activity type string incorrect, got %v", s)
805820
}
806821

807-
if id := ActivityTypes.EBikeRide.Id(); id != 42 {
808-
t.Errorf("activity type id incorrect, got %v", id)
809-
}
810-
811-
if s := ActivityTypes.EBikeRide.String(); s != "EBikeRide" {
812-
t.Errorf("activity type string incorrect, got %v", s)
813-
}
814-
815822
// other
816823
ty := ActivityType(100)
817824
if id := ty.Id(); id != 0 {

0 commit comments

Comments
 (0)