Skip to content

Commit

Permalink
Remove user agent from API requests
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkSession committed Aug 1, 2024
1 parent aded105 commit 405a8b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions custom_components/wellbeing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ async def _get_token(self) -> dict:
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": USER_AGENT
# "User-Agent": USER_AGENT
}
return await self.api_wrapper("post", TOKEN_URL, json, headers)

Expand All @@ -310,7 +310,7 @@ async def _login(self, access_token: str) -> dict:
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": USER_AGENT,
# "User-Agent": USER_AGENT,
"x-api-key": X_API_KEY
}
return await self.api_wrapper("post", AUTHENTICATION_URL, credentials, headers)
Expand All @@ -324,7 +324,7 @@ async def _get_token2(self, id_token: str, country_code: str) -> dict:
headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": USER_AGENT,
# "User-Agent": USER_AGENT,
"Origin-Country-Code": country_code
}
return await self.api_wrapper("post", TOKEN_URL, credentials, headers)
Expand All @@ -334,7 +334,7 @@ async def _get_appliances(self, access_token: str) -> dict:
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": USER_AGENT,
# "User-Agent": USER_AGENT,
"x-api-key": X_API_KEY
}
return await self.api_wrapper("get", APPLIANCES_URL, headers=headers)
Expand All @@ -344,7 +344,7 @@ async def _get_appliance_info(self, access_token: str, pnc_id: str) -> dict:
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": USER_AGENT,
# "User-Agent": USER_AGENT,
"x-api-key": X_API_KEY
}
url = f"{APPLIANCES_URL}/{pnc_id}/info"
Expand Down Expand Up @@ -453,7 +453,7 @@ async def _send_command(self, access_token: str, pnc_id: str, command: dict) ->
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
"Accept": "application/json",
"User-Agent": USER_AGENT,
# "User-Agent": USER_AGENT,
"x-api-key": X_API_KEY
}

Expand Down

0 comments on commit 405a8b2

Please sign in to comment.