diff --git a/pyracing/client.py b/pyracing/client.py index 0df69ed..d4032e5 100644 --- a/pyracing/client.py +++ b/pyracing/client.py @@ -33,7 +33,7 @@ class Client: - def __init__(self, username: str, password: str): + def __init__(self, username: str, password: str, timeout=10.0): """ This class is used to interact with all iRacing endpoints that have been discovered so far. After creating an instance of Client it is required to call authenticate(), due to async limitations. @@ -43,6 +43,7 @@ def __init__(self, username: str, password: str): """ self.username = username self.password = encode_password(username,password) + self.timeout = timeout self.session = httpx.AsyncClient() def _rename_numerical_keys(self, response_item, mapping): @@ -109,7 +110,7 @@ async def _build_request(self, url, params): url, params=params, allow_redirects=False, - timeout=10.0 + timeout=self.timeout ) logger.info(f'Request sent for URL: {response.url}') logger.info(f'Status code of response: {response.status_code}') diff --git a/pyracing/response_objects/session_data.py b/pyracing/response_objects/session_data.py index afa5dee..d576616 100644 --- a/pyracing/response_objects/session_data.py +++ b/pyracing/response_objects/session_data.py @@ -76,6 +76,7 @@ def __init__(self, data): self.car_color_2 = data['car_color2'] self.car_color_3 = data['car_color3'] self.car_id = data['carid'] + self.car_name = parse_encode(data['car_name']) self.car_num = data['carnum'] self.car_num_font = data['carnumberfont'] self.car_num_slant = data['carnumberslant']