Switch example to create_task (#604)

Per https://github.com/home-assistant/core/pull/37741#discussion_r455668639
This commit is contained in:
Daniel Shokouhi 2020-07-16 12:22:00 -07:00 committed by GitHub
parent 462f7732b5
commit 2eb402ae8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,7 +106,7 @@ be done by calling the forward function on the config entry manager ([example](h
```python
# Use `hass.async_add_job` to avoid a circular dependency between the platform and the component
hass.async_add_job(hass.config_entries.async_forward_entry_setup(config_entry, "light"))
hass.async_create_task(hass.config_entries.async_forward_entry_setup(config_entry, "light"))
```
For a platform to support config entries, it will need to add a setup entry method ([example](https://github.com/home-assistant/home-assistant/blob/0.68.0/homeassistant/components/light/hue.py#L60)):