Make adding new device in unifiprotect callback functions (#111054)

This commit is contained in:
J. Nick Koston 2024-02-20 23:47:31 -06:00 committed by GitHub
parent 7eb6614818
commit b1cbf9840a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 22 additions and 11 deletions

View file

@ -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,