INNER CODE UNIT · Python
_async_setup_shared
3dg1luk43/ha_washdata · custom_components/ha_washdata/__init__.py:531
async def _async_setup_shared(
hass: HomeAssistant, log: DeviceLoggerAdapter
) -> None:
"""Register everything that belongs to the HA instance, not to one appliance.
The custom card, the sidebar panel, the WebSocket API, the conversation
intents and the cached integration version are global: the first config
entry brings them up and every later entry is a guarded no-op.
Issue #425: this used to sit near the END of ``async_setup_entry``, so any
earlier per-appliance failure took the whole install's UI down with it - and
because the panel is where almost every setting is edited (including the
``via_device`` link that aborted setup in #418), losing it left the user with
no way to undo the setting that broke setup. Registering it first makes the
panel independent of whether any individual appliance sets up.
Failures inside are already handled per block (the card defers and retries,
the panel logs and retries on the next setup), so a missing UI never fails