Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use new getUserDataForApp endpoint #36

Merged
merged 3 commits into from
Oct 25, 2023
Merged
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
3 changes: 2 additions & 1 deletion src/pyeconet/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,12 @@ async def get_equipment_by_type(self, equipment_type: List) -> Dict:
async def _get_location(self) -> List[Dict]:
_headers = HEADERS.copy()
_headers["ClearBlade-UserToken"] = self._user_token
payload = {"location_only": False, "type": "com.econet.econetconsumerandroid", "version": "6.0.0-375-01b4870e"}

_session = ClientSession()
try:
async with _session.post(
f"{REST_URL}/code/{CLEAR_BLADE_SYSTEM_KEY}/getLocation", headers=_headers
f"{REST_URL}/code/{CLEAR_BLADE_SYSTEM_KEY}/getUserDataForApp", json=payload, headers=HEADERS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@w1ll1am23 typo HEADERS => _headers

) as resp:
if resp.status == 200:
_json = await resp.json()
Expand Down