Skip to content

Commit

Permalink
execute client.get_data in a job_executor, so setup with the stable (…
Browse files Browse the repository at this point in the history
…as of 2021-04-16) version of home assistant will not fail anymore
  • Loading branch information
dunv committed Apr 16, 2021
1 parent 2b7d80e commit 5e31da9
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 5e31da9

Please sign in to comment.