diff --git a/docs/core/platform/backup.md b/docs/core/platform/backup.md new file mode 100644 index 00000000..25852f89 --- /dev/null +++ b/docs/core/platform/backup.md @@ -0,0 +1,24 @@ +--- +title: "Backup" +--- + +When Home Assistant is creating a backup, there might be a need to pause certain operations in the integration, or dumping data so it can properly be restored. + +This is done by adding 2 functions (`async_pre_backup` and `async_post_backup`) to `backup.py` + +## Adding support + +The quickest way to add backup support to a new integration is by using our built-in scaffold template. From a Home Assistant dev environment, run `python3 -m script.scaffold backup` and follow the instructions. + +If you prefer to go the manual route, create a new file in your integration folder called `backup.py` and implement the following method: + +```python +from homeassistant.core import HomeAssistant + + +async def async_pre_backup(hass: HomeAssistant) -> None: + """Perform operations before a backup starts.""" + +async def async_post_backup(hass: HomeAssistant) -> None: + """Perform operations after a backup finishes.""" +``` diff --git a/docs/reproduce_state_index.md b/docs/core/platform/reproduce_state.md similarity index 97% rename from docs/reproduce_state_index.md rename to docs/core/platform/reproduce_state.md index 0c8bcf4f..13931830 100644 --- a/docs/reproduce_state_index.md +++ b/docs/core/platform/reproduce_state.md @@ -1,5 +1,5 @@ --- -title: "Supporting Scenes" +title: "Reproduce State" --- Home Assistant has support for scenes. Scenes are a collection of (partial) entity states. When a scene is activated, Home Assistant will try to call the right services to get the specified scenes in their specified state. diff --git a/docs/significant_change_index.md b/docs/core/platform/significant_change.md similarity index 97% rename from docs/significant_change_index.md rename to docs/core/platform/significant_change.md index 9f95a11a..2e38a30a 100644 --- a/docs/significant_change_index.md +++ b/docs/core/platform/significant_change.md @@ -1,5 +1,5 @@ --- -title: "Significant Change Support" +title: "Significant Change" --- Home Assistant doesn't only collect data, it also exports data to various services. Not all of these services are interested in every change. To help these services filter insignificant changes, your entity integration can add significant change support. diff --git a/sidebars.js b/sidebars.js index 6ae157cd..8e2729e2 100644 --- a/sidebars.js +++ b/sidebars.js @@ -137,10 +137,6 @@ module.exports = { "integration_events", "network_discovery", ], - "Building Entity Integrations": [ - "reproduce_state_index", - "significant_change_index", - ], "Development Checklist": [ "development_checklist", "creating_component_code_review", @@ -155,29 +151,16 @@ module.exports = { ], Entities: [ "core/entity", - "core/entity/air-quality", - "core/entity/alarm-control-panel", - "core/entity/binary-sensor", - "core/entity/button", - "core/entity/camera", - "core/entity/climate", - "core/entity/cover", - "core/entity/device-tracker", - "core/entity/fan", - "core/entity/humidifier", - "core/entity/light", - "core/entity/lock", - "core/entity/media-player", - "core/entity/number", - "core/entity/remote", - "core/entity/select", - "core/entity/sensor", - "core/entity/siren", - "core/entity/switch", - "core/entity/update", - "core/entity/vacuum", - "core/entity/water-heater", - "core/entity/weather", + { + type: 'autogenerated', + dirName: 'core/entity', + }, + ], + Platforms: [ + { + type: 'autogenerated', + dirName: 'core/platform', + }, ], "Device Automations": [ "device_automation_index", diff --git a/static/_redirects b/static/_redirects index fb24fd74..07c2c375 100644 --- a/static/_redirects +++ b/static/_redirects @@ -62,6 +62,9 @@ /docs/lovelace_custom_card /docs/frontend/custom-ui/lovelace-custom-card /docs/supervisor/developing /docs/supervisor/development /docs/dev_101_index /docs/dev_101_hass +/docs/reproduce_state_index /docs/core/platform/reproduce_state +/docs/significant_change_index /docs/core/platform/significant_change + # Tidying moved pages /docs/creating_platform_example_sensor https://github.com/home-assistant/example-custom-config/tree/master/custom_components/example_sensor