diff --git a/custom_components/rtetempo/config_flow.py b/custom_components/rtetempo/config_flow.py index 4ef1895..f7f190f 100644 --- a/custom_components/rtetempo/config_flow.py +++ b/custom_components/rtetempo/config_flow.py @@ -9,7 +9,7 @@ import voluptuous as vol from homeassistant import config_entries -from homeassistant.core import HomeAssistant, callback +from homeassistant.core import callback from homeassistant.data_entry_flow import FlowResult from .api_worker import BadRequest, ServerError, UnexpectedError, application_tester @@ -47,8 +47,7 @@ async def async_step_user( try: client_id = user_input[CONFIG_CLIENT_ID] client_secret = user_input[CONFIG_CLIEND_SECRET] - hass = HomeAssistant() - await hass.async_add_executor_job( + await self.hass.async_add_executor_job( lambda: application_tester(str(client_id), str(client_secret)) ) except RequestException as request_exception: