Skip to content

Commit 43d23a3

Browse files
committed
fix(portaswitch): correct login request parameters and adjust token support condition
1 parent dab2d12 commit 43d23a3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/bss/adapters/portaswitch/adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
)
7171
from .utils import generate_otp_id, extract_fault_code, generate_hash_dictionary
7272

73-
PORTASWITCH_VERSION_WITH_TOKEN: Final[str] = "128"
73+
PORTASWITCH_VERSION_WITH_TOKEN: Final[str] = "MR128"
7474

7575

7676
class PortaSwitchAdapter(BSSAdapter):
@@ -168,7 +168,7 @@ def authenticate(self, user: UserInfo, password: str = None) -> SessionInfo:
168168

169169
token = account_info["password"]
170170
session_data = self._account_api.login(account_info["login"], account_info["password"],
171-
token if actual_portaswitch_mr <= expected_portaswitch_mr_with_token_support else None)
171+
token if actual_portaswitch_mr < expected_portaswitch_mr_with_token_support else None)
172172

173173
return SessionInfo(
174174
user_id=UserId(str(account_info["i_account"])),

app/bss/adapters/portaswitch/api/account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def login(self, login: str, password: str, token: str = None) -> dict:
117117
if token:
118118
params["token"] = token
119119

120-
return self.__send_request(**params)
120+
return self.__send_request(module="Session", method="login", params=params)
121121

122122
def logout(self, access_token: str) -> dict:
123123
"""Performs an account logout.

0 commit comments

Comments
 (0)