Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion jlrpy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
""" Simple Python class to access the JLR Remote Car API
https://github.com/ardevd/jlrpy
"""
import os
import warnings


import calendar
Expand Down Expand Up @@ -72,6 +74,12 @@ def __init__(self,
"grant_type": "refresh_token",
"refresh_token": refresh_token}
else:
warnings.warn(
"Password grant (ROPC) is deprecated per RFC 9700. "
"Use refresh_token authentication instead.",
DeprecationWarning,
stacklevel=2,
)
self.oauth = {
"grant_type": "password",
"username": email,
Expand Down Expand Up @@ -153,7 +161,7 @@ def _set_header(self, access_token):
"X-Device-Id": self.device_id,
"x-telematicsprogramtype": "jlrpy",
"x-App-Id": "ICR_JAGUAR_ANDROID",
"x-App-Secret": "7bf6f544-1926-4714-8066-ceceb40d538d",
"x-App-Secret": os.environ.get("JLR_APP_SECRET", "7bf6f544-1926-4714-8066-ceceb40d538d"),
"Content-Type": "application/json"}

def _authenticate(self, data=None):
Expand Down