File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
src/saic_ismart_client_ng/api Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -69,12 +69,19 @@ async def login(self) -> LoginResp:
6969 "scope" : "all" ,
7070 "deviceId" : f"{ firebase_device_id } ###com.saicmotor.europecar" ,
7171 "deviceType" : "0" , # 2 for huawei
72- "loginType" : "2" if self .__configuration .username_is_email else "1" ,
73- "language" : "EN"
74- if self .__configuration .username_is_email
75- else self .__configuration .phone_country_code ,
72+ "language" : "EN" ,
7673 }
7774
75+ if self .__configuration .username_is_email :
76+ form_body .update ({
77+ "loginType" : "2"
78+ })
79+ else :
80+ form_body .update ({
81+ "loginType" : "1" ,
82+ "countryCode" : self .__configuration .phone_country_code ,
83+ })
84+
7885 result = await self .execute_api_call (
7986 "POST" ,
8087 "/oauth/token" ,
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def setUp(self) -> None:
1111 "test_username" ,
1212 "test_password" ,
1313 True ,
14- "GB " ,
14+ "39 " ,
1515 "https://test-uri.com" ,
1616 "123456" ,
1717 "test_region" ,
@@ -28,7 +28,7 @@ def test_username_is_email(self) -> None:
2828 assert self .config .username_is_email
2929
3030 def test_phone_country_code (self ) -> None :
31- assert self .config .phone_country_code == "GB "
31+ assert self .config .phone_country_code == "39 "
3232
3333 def test_base_uri (self ) -> None :
3434 assert self .config .base_uri == "https://test-uri.com"
You can’t perform that action at this time.
0 commit comments