From 29cbd4f5512358134b865042145de649b94d8477 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Thu, 18 Jan 2024 15:36:29 +0100 Subject: [PATCH] Change add_devices to add_entities (#2041) --- docs/config_entries_index.md | 2 +- docs/creating_platform_code_review.md | 2 +- docs/dev_101_hass.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/config_entries_index.md b/docs/config_entries_index.md index 2b5968c8..8e34d634 100644 --- a/docs/config_entries_index.md +++ b/docs/config_entries_index.md @@ -117,7 +117,7 @@ hass.async_create_task( For a platform to support config entries, it will need to add a setup entry method ([example](https://github.com/home-assistant/core/blob/0.68.0/homeassistant/components/light/hue.py#L60)): ```python -async def async_setup_entry(hass, config_entry, async_add_devices): +async def async_setup_entry(hass, config_entry, async_add_entities): """Set up entry.""" ``` diff --git a/docs/creating_platform_code_review.md b/docs/creating_platform_code_review.md index 786fdf25..c410fcdb 100644 --- a/docs/creating_platform_code_review.md +++ b/docs/creating_platform_code_review.md @@ -53,7 +53,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( ### 3. Setup Platform 1. Verify that the passed in configuration (user/pass/host etc.) works. -2. Group your calls to `add_devices` if possible. +2. Group your calls to `add_entities if possible. 3. If the platform adds extra services, the format should be `.`. So if your integration's domain is "awesome_sauce" and you are making a light platform, you would register services under the `awesome_sauce` domain. Make sure that your services [verify permissions](auth_permissions.md#checking-permissions). ### 4. Entity diff --git a/docs/dev_101_hass.md b/docs/dev_101_hass.md index 4973b1ba..ded3e6ea 100644 --- a/docs/dev_101_hass.md +++ b/docs/dev_101_hass.md @@ -30,7 +30,7 @@ Depending on what you're writing, there are different ways the `hass` object is Passed into `setup(hass, config)` or `async_setup(hass, config)`. **Platform** -Passed into `setup_platform(hass, config, add_devices, discovery_info=None)` or `async_setup_platform(hass, config, async_add_devices, discovery_info=None)`. +Passed into `setup_platform(hass, config, add_entities, discovery_info=None)` or `async_setup_platform(hass, config, async_add_entities, discovery_info=None)`. **Entity** -Available as `self.hass` once the entity has been added via the `add_devices` callback inside a platform. +Available as `self.hass` once the entity has been added via the `add_entities` callback inside a platform.