Skip to content

Commit

Permalink
fix: ensure update_from_dict creates the object is it was previously …
Browse files Browse the repository at this point in the history
…None (#93)
  • Loading branch information
bdraco authored Jun 20, 2024
1 parent 499d479 commit f268c01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uiprotect/data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def update_from_dict(cls: ProtectObject, data: dict[str, Any]) -> ProtectObject:
if (unifi_obj := getattr(cls, key)) is not None:
value = unifi_obj.update_from_dict(item)
else:
value = None
value = unifi_objs[key](**item, api=api)
elif has_unifi_lists and key in unifi_lists and isinstance(item, list):
klass = unifi_lists[key]
value = [
Expand Down

0 comments on commit f268c01

Please sign in to comment.