From 1b5be3826e4257ac18233410f60bd8bbd7e5b53c Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Fri, 15 Sep 2023 08:11:49 +0200 Subject: [PATCH] Add coordinator.py to file structure explanation (#1895) --- docs/creating_integration_file_structure.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/creating_integration_file_structure.md b/docs/creating_integration_file_structure.md index ac7d38e7..06c56cc5 100644 --- a/docs/creating_integration_file_structure.md +++ b/docs/creating_integration_file_structure.md @@ -21,6 +21,11 @@ If your integration is going to integrate one or more devices, you will need to If your integration is going to register services, it will need to provide a description of the available services. The description is stored in `services.yaml`. [More information about `services.yaml`.](dev_101_services.md) +## Data update coordinator - `coordinator.py` + +There are multiple ways for your integration to receive data, including push or poll. Commonly integrations will fetch data with a single coordinated poll across all entities, which requires the use of a `DataUpdateCoordinator`. +If you want to use one, and you choose to create a subclass of it, it is recommended to define the coordinator class in `coordinator.py`. [More information about `DataUpdateCoordinator`](integration_fetching_data.md/#coordinated-single-api-poll-for-data-for-all-entities). + ## Where Home Assistant looks for integrations Home Assistant will look for an integration when it sees the domain referenced in the config file (i.e. `mobile_app:`) or if it is a dependency of another integration. Home Assistant will look at the following locations: