From d03e3ddcedee7ae6bebbf0c2ea0573de8a76833c Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 1 Mar 2019 17:04:03 -0800 Subject: [PATCH] Add lifecycle docs (#190) --- docs/config_entries_index.md | 88 ++++++++++++++++++++++++++++++++++++ website/i18n/en.json | 3 ++ 2 files changed, 91 insertions(+) diff --git a/docs/config_entries_index.md b/docs/config_entries_index.md index 61f8e6c0..265c32bc 100644 --- a/docs/config_entries_index.md +++ b/docs/config_entries_index.md @@ -5,6 +5,94 @@ sidebar_label: Introduction Config Entries are configuration data that are persistently stored by Home Assistant. A config entry is created by a user via the UI. The UI flow is powered by a [config flow handler](config_entries_config_flow_handler.md) as defined by the component. Config entries can also have an extra [options flow handler](config_entries_options_flow_handler.md), also defined by the component. +## Lifeceycle + +| State | Description | +| ----- | ----------- | +| not loaded | The config entry has not been loaded. This is the initial state when a config entry is created or when Home Assistant is restarted. | +| loaded | The config entry has been loaded. | +| setup error | An error occurred when trying to set up the config entry. | +| setup retry | A dependency of the config entry was not ready yet. Home Assistant will automatically retry loading this config entry in the future. Time between attempts will automatically increase. +| migration error | The config entry had to be migrated to a newer version, but the migration failed. +| failed unload | The config entry was attempted to be unloaded, but this was either not supported or it raised an exception. + + + +G + +not loaded + +not loaded + +loaded + +loaded + +not loaded->loaded + + + +setup error + +setup error + +not loaded->setup error + + + +setup retry + +setup retry + +not loaded->setup retry + + + +migration error + +migration error + +not loaded->migration error + + + +loaded->not loaded + + + +failed unload + +failed unload + +loaded->failed unload + + + +setup error->not loaded + + + +setup retry->not loaded + + + + + + + + ## Setting up an entry During startup, Home Assistant first calls the [normal component setup](https://developers.home-assistant.io/docs/en/creating_component_index.html), diff --git a/website/i18n/en.json b/website/i18n/en.json index 6c944654..f676f98a 100644 --- a/website/i18n/en.json +++ b/website/i18n/en.json @@ -75,6 +75,9 @@ "title": "Config Entries", "sidebar_label": "Introduction" }, + "config_entries_options_flow_handler": { + "title": "Options Flow Handlers" + }, "configuration_yaml_index": { "title": "Configuration.yaml", "sidebar_label": "Introduction"