1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Allow passing version to ConfigEntry.async_update_entry (#110077)

Allow passing minor_version and version to ConfigEntry.async_update_entry
This commit is contained in:
Erik Montnemery
2024-02-09 10:10:25 +01:00
committed by GitHub
parent 7caf78a926
commit 793b6aa97d
2 changed files with 12 additions and 3 deletions

View File

@@ -1496,12 +1496,14 @@ class ConfigEntries:
self,
entry: ConfigEntry,
*,
unique_id: str | None | UndefinedType = UNDEFINED,
title: str | UndefinedType = UNDEFINED,
data: Mapping[str, Any] | UndefinedType = UNDEFINED,
minor_version: int | UndefinedType = UNDEFINED,
options: Mapping[str, Any] | UndefinedType = UNDEFINED,
pref_disable_new_entities: bool | UndefinedType = UNDEFINED,
pref_disable_polling: bool | UndefinedType = UNDEFINED,
title: str | UndefinedType = UNDEFINED,
unique_id: str | None | UndefinedType = UNDEFINED,
version: int | UndefinedType = UNDEFINED,
) -> bool:
"""Update a config entry.
@@ -1522,9 +1524,11 @@ class ConfigEntries:
changed = True
for attr, value in (
("title", title),
("minor_version", minor_version),
("pref_disable_new_entities", pref_disable_new_entities),
("pref_disable_polling", pref_disable_polling),
("title", title),
("version", version),
):
if value is UNDEFINED or getattr(entry, attr) == value:
continue