diff --git a/homeassistant/components/bluetooth/__init__.py b/homeassistant/components/bluetooth/__init__.py index f41817b092ef..8a48615bcb0e 100644 --- a/homeassistant/components/bluetooth/__init__.py +++ b/homeassistant/components/bluetooth/__init__.py @@ -338,14 +338,16 @@ async def async_update_device( device.id, new_connections=connections ) break - device_entry = device_registry.async_get_or_create( + device_entry = device_registry.async_get_or_create_device( config_entry_id=entry.entry_id, - name=adapter_human_name(adapter, address), - connections=connections, - manufacturer=details[ADAPTER_MANUFACTURER], - model=adapter_model(details), - sw_version=details.get(ADAPTER_SW_VERSION), - hw_version=details.get(ADAPTER_HW_VERSION), + device_info=dr.DeviceInfo( + name=adapter_human_name(adapter, address), + connections=connections, + manufacturer=details[ADAPTER_MANUFACTURER], + model=adapter_model(details), + sw_version=details.get(ADAPTER_SW_VERSION), + hw_version=details.get(ADAPTER_HW_VERSION), + ), ) if via_device_id and ( split_devices := device_registry.async_get_devices_for_composite_device_id( diff --git a/homeassistant/components/device_tracker/entity.py b/homeassistant/components/device_tracker/entity.py index 191fd402ecc0..f89ee8a8a886 100644 --- a/homeassistant/components/device_tracker/entity.py +++ b/homeassistant/components/device_tracker/entity.py @@ -723,11 +723,13 @@ class ScannerEntity( # Register our own device now that the tracked device is known to another # integration; matching the split of a pre-migration composite device prunes # the identifiers and connections copied from the composite. - device_entry = dr.async_get(self.hass).async_get_or_create( + device_entry = dr.async_get(self.hass).async_get_or_create_device( config_entry_id=self.platform.config_entry.entry_id, config_subentry_id=self.registry_entry.config_subentry_id, - connections={(dr.CONNECTION_NETWORK_MAC, self.mac_address)}, - name=self.hostname or self.mac_address, + device_info=dr.DeviceInfo( + connections={(dr.CONNECTION_NETWORK_MAC, self.mac_address)}, + name=self.hostname or self.mac_address, + ), ) # Link the entity's registry entry to the device diff --git a/homeassistant/components/google_assistant/__init__.py b/homeassistant/components/google_assistant/__init__.py index aebe751ee16a..a26e1181656e 100644 --- a/homeassistant/components/google_assistant/__init__.py +++ b/homeassistant/components/google_assistant/__init__.py @@ -138,13 +138,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: GoogleConfigEntry) -> No config.update(entry.data) device_registry = dr.async_get(hass) - device_registry.async_get_or_create( + device_registry.async_get_or_create_device( config_entry_id=entry.entry_id, - identifiers={(DOMAIN, config[CONF_PROJECT_ID])}, - manufacturer="Google", - model="Google Assistant", - name=config[CONF_PROJECT_ID], - entry_type=dr.DeviceEntryType.SERVICE, + device_info=dr.DeviceInfo( + identifiers={(DOMAIN, config[CONF_PROJECT_ID])}, + manufacturer="Google", + model="Google Assistant", + name=config[CONF_PROJECT_ID], + entry_type=dr.DeviceEntryType.SERVICE, + ), ) google_config = GoogleConfig(hass, config) diff --git a/homeassistant/components/mqtt/entity.py b/homeassistant/components/mqtt/entity.py index 0b4a27db76d4..527149e63b2d 100644 --- a/homeassistant/components/mqtt/entity.py +++ b/homeassistant/components/mqtt/entity.py @@ -1441,9 +1441,9 @@ def ensure_via_device_exists( "Device Registry, creating new entry", identifier, ) - device_registry.async_get_or_create( + device_registry.async_get_or_create_device( config_entry_id=config_entry.entry_id, - identifiers={identifier}, + device_info=dr.DeviceInfo(identifiers={identifier}), )