mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-19 15:26:29 +00:00
Change add_devices to add_entities (#2041)
This commit is contained in:
parent
f53bdd6cb9
commit
29cbd4f551
@ -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."""
|
||||
```
|
||||
|
||||
|
@ -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 `<domain of your integration>.<service name>`. 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
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user