Increase httpx timeout for Tesla (#50376)

This commit is contained in:
Alan Tse 2021-05-09 14:30:38 -07:00 committed by GitHub
parent 041838bdd7
commit c1a316b2ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ async def async_setup_entry(hass, config_entry):
hass.data.setdefault(DOMAIN, {}) hass.data.setdefault(DOMAIN, {})
config = config_entry.data config = config_entry.data
# Because users can have multiple accounts, we always create a new session so they have separate cookies # Because users can have multiple accounts, we always create a new session so they have separate cookies
async_client = httpx.AsyncClient(headers={USER_AGENT: SERVER_SOFTWARE}) async_client = httpx.AsyncClient(headers={USER_AGENT: SERVER_SOFTWARE}, timeout=60)
email = config_entry.title email = config_entry.title
if email in hass.data[DOMAIN] and CONF_SCAN_INTERVAL in hass.data[DOMAIN][email]: if email in hass.data[DOMAIN] and CONF_SCAN_INTERVAL in hass.data[DOMAIN][email]:
scan_interval = hass.data[DOMAIN][email][CONF_SCAN_INTERVAL] scan_interval = hass.data[DOMAIN][email][CONF_SCAN_INTERVAL]

View File

@ -149,7 +149,7 @@ async def validate_input(hass: core.HomeAssistant, data):
""" """
config = {} config = {}
async_client = httpx.AsyncClient(headers={USER_AGENT: SERVER_SOFTWARE}) async_client = httpx.AsyncClient(headers={USER_AGENT: SERVER_SOFTWARE}, timeout=60)
try: try:
controller = TeslaAPI( controller = TeslaAPI(