Make adding new device in unifiprotect callback functions (#111054)
This commit is contained in:
parent
7eb6614818
commit
b1cbf9840a
11 changed files with 22 additions and 11 deletions
|
@ -113,7 +113,8 @@ async def async_setup_entry(
|
|||
"""Discover devices on a UniFi Protect NVR."""
|
||||
data: ProtectData = hass.data[DOMAIN][entry.entry_id]
|
||||
|
||||
async def _add_new_device(device: ProtectAdoptableDeviceModel) -> None:
|
||||
@callback
|
||||
def _add_new_device(device: ProtectAdoptableDeviceModel) -> None:
|
||||
entities = async_all_device_entities(
|
||||
data,
|
||||
ProtectButton,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue