Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-blocking call to load MyT #293

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions custom_components/toyota/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import asyncio.exceptions as asyncioexceptions
import logging
from datetime import timedelta
from functools import partial
from typing import Optional, TypedDict

import httpcore
Expand Down Expand Up @@ -53,9 +54,12 @@ async def async_setup_entry( # pylint: disable=too-many-statements
email = entry.data[CONF_EMAIL]
password = entry.data[CONF_PASSWORD]

client = MyT(
username=email,
password=password,
client = await hass.async_add_executor_job(
partial(
MyT,
username=email,
password=password,
)
)

try:
Expand Down