Skip to content

Commit cf78381

Browse files
committed
Added count activities to demo
1 parent b622c8a commit cf78381

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
hooks:
3737
- id: mypy
3838
name: mypy type checking
39-
entry: pdm run mypy garminconnect tests
39+
entry: bash -c 'cd "$PWD" && .venv/bin/mypy garminconnect tests'
4040
types: [python]
4141
language: system
4242
pass_filenames: false

demo.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ def __init__(self):
270270
"desc": "Get scheduled workout by ID",
271271
"key": "get_scheduled_workout_by_id",
272272
},
273+
"p": {
274+
"desc": "Count activities for current user",
275+
"key": "count_activities",
276+
},
273277
},
274278
},
275279
"6": {
@@ -2497,7 +2501,6 @@ def add_and_remove_gear_to_activity(api: Garmin) -> None:
24972501
if gear_list:
24982502
activities = api.get_activities(0, 1)
24992503
if activities:
2500-
25012504
activity_id = activities[0].get("activityId")
25022505
activity_name = activities[0].get("activityName")
25032506
for gear in gear_list:
@@ -3298,6 +3301,11 @@ def execute_api_call(api: Garmin, key: str) -> None:
32983301
"get_scheduled_workout_by_id": lambda: get_scheduled_workout_by_id_data(
32993302
api
33003303
),
3304+
"count_activities": lambda: call_and_display(
3305+
api.count_activities,
3306+
method_name="count_activities",
3307+
api_call_desc="api.count_activities()",
3308+
),
33013309
# Body Composition & Weight
33023310
"get_body_composition": lambda: call_and_display(
33033311
api.get_body_composition,

0 commit comments

Comments
 (0)