mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Remove redundant device update code (#134100)
Remove redundant device update steps
This commit is contained in:
parent
ff80a7c5bc
commit
877e44e3c9
@ -958,16 +958,6 @@ class DeviceRegistry(BaseRegistry[dict[str, list[dict[str, Any]]]]):
|
|||||||
new_values["config_entries"] = config_entries
|
new_values["config_entries"] = config_entries
|
||||||
old_values["config_entries"] = old.config_entries
|
old_values["config_entries"] = old.config_entries
|
||||||
|
|
||||||
for attr_name, setvalue in (
|
|
||||||
("connections", merge_connections),
|
|
||||||
("identifiers", merge_identifiers),
|
|
||||||
):
|
|
||||||
old_value = getattr(old, attr_name)
|
|
||||||
# If not undefined, check if `value` contains new items.
|
|
||||||
if setvalue is not UNDEFINED and not setvalue.issubset(old_value):
|
|
||||||
new_values[attr_name] = old_value | setvalue
|
|
||||||
old_values[attr_name] = old_value
|
|
||||||
|
|
||||||
if merge_connections is not UNDEFINED:
|
if merge_connections is not UNDEFINED:
|
||||||
normalized_connections = self._validate_connections(
|
normalized_connections = self._validate_connections(
|
||||||
device_id,
|
device_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user