@@ -842,7 +842,6 @@ def async_get_or_create(
842842 device .id ,
843843 allow_collisions = True ,
844844 add_config_entry_id = config_entry_id ,
845- add_config_entry = config_entry ,
846845 configuration_url = configuration_url ,
847846 device_info_type = device_info_type ,
848847 disabled_by = disabled_by ,
@@ -870,7 +869,6 @@ def async_update_device( # noqa: C901
870869 self ,
871870 device_id : str ,
872871 * ,
873- add_config_entry : ConfigEntry | UndefinedType = UNDEFINED ,
874872 add_config_entry_id : str | UndefinedType = UNDEFINED ,
875873 # Temporary flag so we don't blow up when collisions are implicitly introduced
876874 # by calls to async_get_or_create. Must not be set by integrations.
@@ -905,13 +903,11 @@ def async_update_device( # noqa: C901
905903
906904 config_entries = old .config_entries
907905
908- if add_config_entry_id is not UNDEFINED and add_config_entry is UNDEFINED :
909- config_entry = self .hass .config_entries .async_get_entry (add_config_entry_id )
910- if config_entry is None :
906+ if add_config_entry_id is not UNDEFINED :
907+ if self .hass .config_entries .async_get_entry (add_config_entry_id ) is None :
911908 raise HomeAssistantError (
912909 f"Can't link device to unknown config entry { add_config_entry_id } "
913910 )
914- add_config_entry = config_entry
915911
916912 if not new_connections and not new_identifiers :
917913 raise HomeAssistantError (
0 commit comments