Fix cert expiry config flow check and update#26638
Conversation
MartinHjelmare
left a comment
There was a problem hiding this comment.
Can we fix the call to get_cert in the config flow in this PR too?
would be good, but i have no clue how to do it ... |
|
Do this: async def _test_connection(self, user_input):
"""Test connection to the server and try to get the certificate."""
try:
await self.hass.async_add_executor_job(
get_cert, user_input[CONF_HOST], user_input.get(CONF_PORT, DEFAULT_PORT))
return True
except socket.gaierror:
self._errors[CONF_HOST] = "resolve_failed"
except socket.timeout:
self._errors[CONF_HOST] = "connection_timeout"
except OSError:
self._errors[CONF_HOST] = "certificate_fetch_failed"
return FalseDo this: if await self._test_connection(user_input): |
|
i was trying something like that but it did not work ... |
|
We can't call await self.hass.async_add_executor_job(get_cert, arg1, arg2) |
|
Thanks i really have some learning todo with the async io system .... All items are solved now, so lets hope we can get it fixed before 0.99 is released |
|
Hi guys, not sure if this is the right place to comment but I've applied these changes to the code and the behaviour is still the same: no sensor gets created using yaml and I get a timeout error using config flow. |
|
Can you test the site/certificate separately? |
|
can you try with the same python as hass is running the next code?
and see what it returns? |
|
@MartinHjelmare what would be the problem with the CI for python 2.6? |
|
Test fails because of wrong handling with asyncio |
* Fix typo in translations * Work on bug #26619 * readd the homeassistant.start event * Remove the callback * Added the executor_job for _test_connection * Update test_config_flow.py

Description:
Related issue (if applicable): fixes #26619
Checklist:
tox. Your PR cannot be merged unless tests pass