Skip to content

Commit

Permalink
Fix SpO2 formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
veerendra2 committed Dec 24, 2024
1 parent 6dc31c1 commit 5a8ac37
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion fitbit_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
fitbit_cli Module
"""

__version__ = "0.1.1"
__version__ = "1.0.0"
4 changes: 2 additions & 2 deletions fitbit_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def parse_arguments():

parser.add_argument(
"-i",
"--init",
"--init-auth",
action="store_true",
help="Run interative setup to fetch token.",
help="Initialize Fitbit authentication setup.",
)

group = parser.add_argument_group(
Expand Down
10 changes: 5 additions & 5 deletions fitbit_cli/fitbit_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ def read_fitbit_token():
try:
with open(FITBIT_TOKEN_PATH, "r", encoding="utf-8") as f:
token_content = json.load(f)
except FileNotFoundError:
except FileNotFoundError as e:
raise FitbitInitError(
f"Token file not found at {FITBIT_TOKEN_PATH}. Please run the initialization with --init"
)
f"Token file not found at {FITBIT_TOKEN_PATH}. Please run the initialization with --init-auth"
) from e
except json.JSONDecodeError:
raise FitbitInitError(
"Error decoding the token file. Please re-run the initialization with --init"
)
"Error decoding the token file. Please re-run the initialization with --init-auth"
) from e

return token_content

Expand Down
8 changes: 4 additions & 4 deletions fitbit_cli/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ def display_spo2(spo2_data):

for spo2 in spo2_data:
table.add_row(
spo2["dateTime"],
str(spo2["value"].get("min", "N/A")),
str(spo2["value"].get("avg", "N/A")),
str(spo2["value"].get("max", "N/A")),
spo2.get("dateTime", "N/A"),
str(spo2.get("value", {}).get("min", "N/A")),
str(spo2.get("value", {}).get("avg", "N/A")),
str(spo2.get("value", {}).get("max", "N/A")),
)

CONSOLE.print(table)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
keywords=["fitbit", "cli", "python"],
license="MIT",
classifiers=[
"Development Status :: 4 - Beta",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
Expand Down

0 comments on commit 5a8ac37

Please sign in to comment.