mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-18 23:06:31 +00:00
Update device registry code sample (#1029)
`async_get_registry` is legacy.
This commit is contained in:
parent
92b2bc0932
commit
67c9ffc6be
@ -74,7 +74,7 @@ Components are also able to register devices in the case that there are no entit
|
||||
# Inside a component
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
|
||||
device_registry = await dr.async_get_registry(hass)
|
||||
device_registry = dr.async_get(hass)
|
||||
|
||||
device_registry.async_get_or_create(
|
||||
config_entry_id=entry.entry_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user