Switch sabnzbd to use async_add_executor_job (#41835)

This commit is contained in:
J. Nick Koston 2020-10-14 13:27:34 -05:00 committed by GitHub
parent 68cfc36b6b
commit 9d9520b2f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,7 +110,9 @@ async def async_configure_sabnzbd(
uri_scheme = "https" if use_ssl else "http"
base_url = BASE_URL_FORMAT.format(uri_scheme, host, port)
if api_key is None:
conf = await hass.async_add_job(load_json, hass.config.path(CONFIG_FILE))
conf = await hass.async_add_executor_job(
load_json, hass.config.path(CONFIG_FILE)
)
api_key = conf.get(base_url, {}).get(CONF_API_KEY, "")
sab_api = SabnzbdApi(