Skip to content

Commit

Permalink
Fix Nexity login and add extra Nexity setup test (#344)
Browse files Browse the repository at this point in the history
* Move io outside of event loop

* Add extra Nexity setup definition
  • Loading branch information
iMicknl authored Jan 26, 2022
1 parent 883879c commit 9a4284c
Show file tree
Hide file tree
Showing 3 changed files with 5,858 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pyoverkiz/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,14 @@ async def nexity_login(self) -> str:
"""
loop = asyncio.get_event_loop()

def _get_client() -> boto3.session.Session.client:
return boto3.client(
"cognito-idp", config=Config(region_name=NEXITY_COGNITO_REGION)
)

# Request access token
client = boto3.client(
"cognito-idp", config=Config(region_name=NEXITY_COGNITO_REGION)
)
client = await loop.run_in_executor(None, _get_client)

aws = WarrantLite(
username=self.username,
password=self.password,
Expand Down
Loading

0 comments on commit 9a4284c

Please sign in to comment.