Skip to content

Commit 618ada6

Browse files
authored
Ensure Reolink host device is setup first (home-assistant#145843)
1 parent 2d6802e commit 618ada6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

homeassistant/components/reolink/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,14 @@ def async_privacy_mode_change() -> None:
233233
"privacy_mode_change", async_privacy_mode_change, 623
234234
)
235235

236+
# ensure host device is setup before connected camera devices that use via_device
237+
device_registry = dr.async_get(hass)
238+
device_registry.async_get_or_create(
239+
config_entry_id=config_entry.entry_id,
240+
identifiers={(DOMAIN, host.unique_id)},
241+
connections={(dr.CONNECTION_NETWORK_MAC, host.api.mac_address)},
242+
)
243+
236244
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
237245

238246
config_entry.async_on_unload(

0 commit comments

Comments
 (0)