I’m creating the config flow for worldtidesinfocustom https://github.com/jugla/worldtidesinfocustom
I’m trying to implement config_flow as a 2nd entry for the sensor.
I fall on issue that I/O are implemented in sync metod (via package requests
).
From function point of view , the sensor entity call several function toward this I/O request in sync mode.
I only redirect async_update()
to update()
method.
To protect from the event loop , I have added hass.async_add_executor_job
.
Issue : I have always a message that say the hass.async_add_executor_job
shall be put just in front of of I/O whereas at this step I’m in sync … (i.e. I cannot put await
…)
Any idea ?
My code is https://github.com/jugla/worldtidesinfocustom/blob/ef19c623d7a7a075295c419a1b2a54b2ef1caf12/custom_components/worldtidesinfocustom/sensor.py around line 486 for async_update()
method