You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/src/renault_api/cli/charge/history.py b/src/renault_api/cli/charge/history.py
index 7cbf988..9311f7c 100644
--- a/src/renault_api/cli/charge/history.py+++ b/src/renault_api/cli/charge/history.py@@ -1,4 +1,5 @@
"""CLI function for a vehicle."""
+import json
from typing import Any
from typing import Dict
from typing import List
@@ -33,6 +34,9 @@ async def sessions(
details = await vehicle.get_details()
response = await vehicle.get_charges(start=parsed_start, end=parsed_end)
charges: List[Dict[str, Any]] = response.raw_data["charges"]
+ if ctx_data["json"]:+ click.echo(json.dumps(charges))+ return
if not charges: # pragma: no cover
click.echo("No data available.")
return
... it outputs a text table.
The text was updated successfully, but these errors were encountered: