Skip to content

Commit

Permalink
Merge pull request #23 from dunv/feature/fixAsyncSetupIssue
Browse files Browse the repository at this point in the history
execute client.get_data in a job_executor
  • Loading branch information
asev committed Jun 4, 2021
2 parents 2b7d80e + 5e31da9 commit 0470096
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/uponor/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ async def async_step_user(self, user_input=None):

try:
client = UponorJnap(user_input[CONF_HOST])
self._api_response = client.get_data()
except:
self._api_response = await self.hass.async_add_executor_job(client.get_data)
except Exception as e:
return self.async_show_form(
step_id="user",
data_schema=self.schema,
errors={"base": "invalid_host"}
errors={"base": "invalid_host", "debug": repr(e)}
)

self._entry_data = user_input
Expand Down

0 comments on commit 0470096

Please sign in to comment.