Skip to content

Commit 0d91b93

Browse files
committed
Fixed example weigh-in data
1 parent 9f93af0 commit 0d91b93

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

example.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,9 @@ def switch(api, i):
704704
)
705705
elif i == "E":
706706
# Add a weigh-in
707-
weight = 83.6
708-
unit = "kg"
709707
display_json(
710-
f"api.add_weigh_in(weight={weight}, unitKey={unit})",
711-
api.add_weigh_in(weight=weight, unitKey=unit),
708+
f"api.add_weigh_in(weight={weight}, unitKey={weightunit})",
709+
api.add_weigh_in(weight=weight, unitKey=weightunit),
712710
)
713711

714712
# Add a weigh-in with timestamps
@@ -718,10 +716,10 @@ def switch(api, i):
718716
gmt_timestamp = weigh_in_date.astimezone(timezone.utc).strftime('%Y-%m-%dT%H:%M:%S')
719717

720718
display_json(
721-
f"api.add_weigh_in_with_timestamps(weight={weight}, unitKey={unit}, dateTimestamp={local_timestamp}, gmtTimestamp={gmt_timestamp})",
719+
f"api.add_weigh_in_with_timestamps(weight={weight}, unitKey={weightunit}, dateTimestamp={local_timestamp}, gmtTimestamp={gmt_timestamp})",
722720
api.add_weigh_in_with_timestamps(
723721
weight=weight,
724-
unitKey=unit,
722+
unitKey=weightunit,
725723
dateTimestamp=local_timestamp,
726724
gmtTimestamp=gmt_timestamp
727725
)

0 commit comments

Comments
 (0)