Skip to content

Commit

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

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

Expand Down

0 comments on commit 36a0970

Please sign in to comment.