Skip to content

Commit

Permalink
fix(data): initialize keyrings and ulp_users as empty dictionaries; u…
Browse files Browse the repository at this point in the history
…pdate return type in dict_from_unifi_list
  • Loading branch information
RaHehl committed Dec 7, 2024
1 parent 1d23987 commit b7bf1b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/uiprotect/data/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ class Bootstrap(ProtectBaseObject):
# agreements

# not directly from UniFi
keyrings: dict[str, Keyring] | None = None
ulp_users: dict[str, UlpUser] | None = None
keyrings: dict[str, Keyring] = {}
ulp_users: dict[str, UlpUser] = {}
events: dict[str, Event] = FixSizeOrderedDict()
capture_ws_stats: bool = False
mac_lookup: dict[str, ProtectDeviceRef] = {}
Expand Down
2 changes: 1 addition & 1 deletion src/uiprotect/data/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def create_from_unifi_dict(
def dict_from_unifi_list(
api: ProtectApiClient, unifi_list: list[dict[str, ProtectModelWithId]]
) -> dict[str, ProtectModelWithId]:
return_dict: dict[str, Any] = {}
return_dict: dict[str, ProtectModelWithId] = {}
for obj_dict in unifi_list:
obj = create_from_unifi_dict(obj_dict, api)
return_dict[cast(ProtectModelWithId, obj).id] = obj
Expand Down

0 comments on commit b7bf1b2

Please sign in to comment.