From 5e31da97c49a1464dd3dea336983fc1a2987e7bb Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 16 Apr 2021 12:13:57 +0200 Subject: [PATCH] execute client.get_data in a job_executor, so setup with the stable (as of 2021-04-16) version of home assistant will not fail anymore --- custom_components/uponor/config_flow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/uponor/config_flow.py b/custom_components/uponor/config_flow.py index 75db16e..dcaf043 100644 --- a/custom_components/uponor/config_flow.py +++ b/custom_components/uponor/config_flow.py @@ -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