Update config_entries_index.md

This commit is contained in:
Paulus Schoutsen 2019-03-07 10:15:53 -08:00 committed by GitHub
parent bd46242622
commit 9ad66609ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,3 +123,12 @@ add `async_unload_entry(hass, entry)` to your component ([example](https://githu
Platforms will not need to add any logic for unloading a config entry. The entity component will take care of this.
If you need to clean up resources used for an entity, implement the `async_will_remove_from_hass` method on the Entity ([example](https://github.com/home-assistant/home-assistant/blob/0.68.0/homeassistant/components/media_player/cast.py#L313)).
## Removal of entries
If a component needs to clean up code when an entry is removed, it can define a removal method:
```python
def async_remove_entry(hass, entry) -> None:
"""Handle removal of an entry."""
```