-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add keyring and ulp-user (#299)
* feat(keyring): add sample data for testing purposes * feat(api): add ulp-user and keyring integration * chore(pre-commit.ci): auto fixes * feat(keyrings): work in progress on adding keyrings functionality * chore(pre-commit.ci): auto fixes * refactor(api): streamline keyrings and ulpusers handling in ProtectApiClient * chore(pre-commit.ci): auto fixes * feat(api): add dict_from_unifi_list function and refactor keyrings and ulpusers retrieval * chore(pre-commit.ci): auto fixes * refactor(api): replace get_keyrings and get_ulpusers methods with direct dict_from_unifi_list calls * chore(pre-commit.ci): auto fixes * fix(api): conditionally assign keyrings and ulp_users based on NVR version * chore(pre-commit.ci): auto fixes * refactor(api): update dict_from_unifi_list to use Any type for return dictionary * fix(api): convert keys to snake_case in ProtectBaseObject data processing * refactor(api): rename keyring and ulp_user update methods for clarity and improve message processing * test(api): add websocket tests for keyring add, update, and remove actions * chore(pre-commit.ci): auto fixes * test(api): add websocket tests for keyring add actions with NFC and fingerprint * feat(api): define NFC fingerprint support version as constant * test(api): improve formatting in NFC keyring add test * refactor(api): improve bootstrap update pop after keyring ulpusr requests * chore(pre-commit.ci): auto fixes * refactor(api): remove to_snake_case from update_from_dict * refactor(api): typed dict_from_unifi_list * chore(pre-commit.ci): auto fixes * refactor(api): update dict_from_unifi_list to use ProtectModelWithId type * refactor(api): consolidate keyring and ULP user message processing into a single method * chore(pre-commit.ci): auto fixes * refactor(api): update device key retrieval and add ULP user management tests * chore(pre-commit.ci): auto fixes * refactor(api): improve object removal and update handling in Bootstrap class * chore(pre-commit.ci): auto fixes * refactor(api): streamline action handling in Bootstrap class * refactor(api): remove unused user message processing method in Bootstrap class * refactor(api): move dict_from_unifi_list function to convert module * chore(pre-commit.ci): auto fixes * test(api): add tests for force update with version checks * chore(pre-commit.ci): auto fixes * test(api): remove outdated NFC fingerprint support version tests * test(data): remove additional keys from obj_dict in bootstrap test * fix(data): enhance type checking for model class in bootstrap and update return type in create_from_unifi_dict * fix(data): improve type handling in Bootstrap and convert functions for better type safety * fix(api): enhance type safety by casting keyrings and ulp_users in ProtectApiClient * chore(pre-commit.ci): auto fixes * fix(api): remove type check for ProtectModelWithId and enhance mock data in tests * chore(pre-commit.ci): auto fixes * fix(api): add debug logging for unexpected websocket actions and enhance tests for user removal and updates * chore(pre-commit.ci): auto fixes * fix(data): initialize keyrings and ulp_users as empty dictionaries; update return type in dict_from_unifi_list * fix: lint --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: J. Nick Koston <[email protected]>
- Loading branch information
1 parent
432da70
commit c8a3f4c
Showing
10 changed files
with
817 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
{ | ||
"deviceType": "camera", | ||
"deviceId": "1c9a2db4df6efda47a3509be", | ||
"registryType": "nfc", | ||
"registryId": "64B2A621", | ||
"lastActivity": 1732904108638, | ||
"ulpUser": "73791632-9805-419c-8351-f3afaab8f064", | ||
"id": "672b573764f79603e400031d", | ||
"modelKey": "keyring" | ||
}, | ||
{ | ||
"deviceType": "camera", | ||
"deviceId": "1c9a2db4df6efda47a3509be", | ||
"registryType": "fingerprint", | ||
"registryId": "1", | ||
"lastActivity": 1732904119477, | ||
"ulpUser": "0ef32f28-f654-404d-ab34-30e373e66436", | ||
"id": "672b573764f79603e44871d", | ||
"modelKey": "keyring" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[ | ||
{ | ||
"ulpId": "73791632-9805-419c-8351-f3afaab8f064", | ||
"firstName": "John Doe", | ||
"lastName": "", | ||
"fullName": "John Doe", | ||
"avatar": "", | ||
"status": "ACTIVE", | ||
"id": "73791632-9805-419c-8351-f3afaab8f064", | ||
"modelKey": "ulpUser" | ||
}, | ||
{ | ||
"ulpId": "ddec43ea-1845-4a50-bdab-83bcd4b3c81d", | ||
"firstName": "Jane Doe", | ||
"lastName": "", | ||
"fullName": "Jane Doe", | ||
"avatar": "", | ||
"status": "ACTIVE", | ||
"id": "ddec43ea-1845-4a50-bdab-83bcd4b3c81d", | ||
"modelKey": "ulpUser" | ||
}, | ||
{ | ||
"ulpId": "0ef32f28-f654-404d-ab34-30e373e66436", | ||
"firstName": "You Know Who", | ||
"lastName": "", | ||
"fullName": "You Know Who", | ||
"avatar": "/proxy/users/public/avatar/1732954155_589f14b3-b137-4487-9823-db62bb793c19.jpg", | ||
"status": "DEACTIVATED", | ||
"id": "0ef32f28-f654-404d-ab34-30e373e66436", | ||
"modelKey": "ulpUser" | ||
} | ||
] |
Oops, something went wrong.