mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-27 19:26:29 +00:00
Add blog post about directly altering ConfigEntry objects (#2080)
* Add blog post about directly altering ConfigEntry objects * Update blog/2024-02-12-async_update_entry.md Co-authored-by: Teemu R. <tpr@iki.fi> * Update blog/2024-02-12-async_update_entry.md * Update blog/2024-02-12-async_update_entry.md Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Teemu R. <tpr@iki.fi> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
069ca79803
commit
8ba4e02fad
22
blog/2024-02-12-async_update_entry.md
Normal file
22
blog/2024-02-12-async_update_entry.md
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
author: J. Nick Koston
|
||||
authorURL: https://github.com/bdraco
|
||||
title: Altering config entries
|
||||
---
|
||||
|
||||
Starting from Home Assistant 2024.3, modifications to a `ConfigEntry` should use `hass.config_entries.async_update_entry`.
|
||||
Directly setting attributes on the `ConfigEntry` object is deprecated and will start to fail in version 2024.9 and later.
|
||||
There is no deprecation period for directly setting `unique_id` on the `ConfigEntry` as doing so will corrupt the internal state, and doing so will start to fail immediately.
|
||||
|
||||
The following attributes must now be set via `hass.config_entries.async_update_entry`:
|
||||
|
||||
- data
|
||||
- minor_version
|
||||
- options
|
||||
- pref_disable_new_entities
|
||||
- pref_disable_polling
|
||||
- title
|
||||
- unique_id
|
||||
- version
|
||||
|
||||
Tests must ensure that `MockConfigEntry` objects are added to Home Assistant via `entry.add_to_hass(hass)` before calling `hass.config_entries.async_update_entry`.
|
Loading…
x
Reference in New Issue
Block a user