Skip to content

Commit

Permalink
fix: crash on parsing related_pircam
Browse files Browse the repository at this point in the history
  • Loading branch information
petrleocompel committed Aug 6, 2024
1 parent 0530ac0 commit 604dc08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion custom_components/hikvision_axpro/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,12 @@ def from_dict(obj: Any) -> 'ZoneConfig':
_LOGGER.warning("Detector info: %s", obj)
cross_zone_cfg = None
arm_no_bypass_enabled = from_union([from_bool, from_none], obj.get("armNoBypassEnabled"))
related_pircam = from_union([RelatedPIRCAM.from_dict, from_none], obj.get("RelatedPIRCAM"))
try:
related_pircam = from_union([RelatedPIRCAM.from_dict, from_none], obj.get("RelatedPIRCAM"))
except:
_LOGGER.warning("Invalid relatedPIRCAM %s", obj.get("CrossZoneCfg"))
_LOGGER.warning("Detector info: %s", obj)
related_pircam = None
arm_mode = from_union([ArmModeConf, from_none], obj.get("armMode"))
zone_attrib = from_union([ZoneAttrib, from_none], obj.get("zoneAttrib"))
final_door_exit_enabled = from_union([from_bool, from_none], obj.get("finalDoorExitEnabled"))
Expand Down

0 comments on commit 604dc08

Please sign in to comment.