Skip to content

Commit

Permalink
create const.py and create constants for url and header
Browse files Browse the repository at this point in the history
  • Loading branch information
tr4nt0r committed Feb 19, 2024
1 parent 99808b3 commit 4df19c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
13 changes: 4 additions & 9 deletions bring_api/bring.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import aiohttp

from bring_api.const import API_BASE_URL, DEFAULT_HEADERS

from .exceptions import (
BringAuthException,
BringEMailInvalidException,
Expand Down Expand Up @@ -41,16 +43,9 @@ def __init__(
self.uuid = ""
self.public_uuid = ""

self.url = "https://api.getbring.com/rest/"
self.url = API_BASE_URL

self.headers = {
"Authorization": "Bearer",
"X-BRING-API-KEY": "cof4Nc6D8saplXjE3h3HXqHH8m7VU2i1Gs0g85Sp",
"X-BRING-CLIENT": "android",
"X-BRING-APPLICATION": "bring",
"X-BRING-COUNTRY": "DE",
"X-BRING-USER-UUID": "",
}
self.headers = DEFAULT_HEADERS

async def login(self) -> BringAuthResponse:
"""Try to login.
Expand Down
12 changes: 12 additions & 0 deletions bring_api/const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""Constants for bring-api."""
from typing import Final

API_BASE_URL: Final = "https://api.getbring.com/rest/"
DEFAULT_HEADERS: Final = {
"Authorization": "Bearer",
"X-BRING-API-KEY": "cof4Nc6D8saplXjE3h3HXqHH8m7VU2i1Gs0g85Sp",
"X-BRING-CLIENT": "android",
"X-BRING-APPLICATION": "bring",
"X-BRING-COUNTRY": "DE",
"X-BRING-USER-UUID": "",
}

0 comments on commit 4df19c5

Please sign in to comment.