Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add system_health to the hassio pre-imports to avoid a late executor job
`2024-03-05 17:01:33.034 DEBUG (MainThread) [homeassistant.loader] Importing platforms for hassio executor=[system_health] loop=[] took 0.12s`
This one does not take that much time but it happens at a time where
the import executor is the most busy during startup
* key
* move patch as its too early now
* Run more of hassio setup in in tasks
There were a few more places were we waited in sequence
where we have to make remote api calls that could be
moved to tasks
* tweak
* tweak
* Split up hassio coordinator and data into new file to allow preload
Since we cannot mark hassio as having a config_flow, it will
not get preloaded and since cloud will almost always load right
after it and block the import executor, we want to preload
the hassio config_flow and platform modules so the other
dependants can continue on while cloud is being imported
to not delay startup
* tweak
* tweak
Reduce supervisor setup time
The two calls that take the most time are calling
push_config ~0.4s and updating the api ~0.35s and
can be run concurrently
panel_custom never suspends so we can avoid the overhead of
creating and scheduling tasks
e398accc3e/homeassistant/components/panel_custom/__init__.py (L74)
panel_custom.async_register_panel could be converted to a normal function but it
would be a breaking change
* Avoid reconstructing the hassio command URL each request
The host had to be re-encoded every time which creates an ip_address object
By doing a join we avoid this. It was actually happening twice since
we passed constructed the URL for testing and than passed it as a string
so aiohttp did it as well
* make url the same
* Add pylint plugin to check if coordinator is placed in its own module
* Remove unintended changes
* Remove pylint disable and let CI only fail on W,E,F
* Make check conventional
* Apply review suggestion
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Use option instead
* Remove pylint arguments from pre-commit
* Partially revert "Remove pylint disable and let CI only fail on W,E,F"
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>