Skip to content

Commit

Permalink
fix: undocumented accessModuleType transmitter #55
Browse files Browse the repository at this point in the history
  • Loading branch information
petrleocompel committed Jul 31, 2023
1 parent 1bb8aeb commit 2964f46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/hikvision_axpro/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class AccessModuleType(Enum):
KEYPAD = "keypad"
# Undocumented type
INPUT_MAIN_ZONE = "inputMainZone"
TRANSMITTER = "transmitter"


class DetectorType(Enum):
Expand Down Expand Up @@ -717,7 +718,12 @@ def from_dict(obj: Any) -> 'ZoneConfig':
tamper_resistence = from_union([from_float, from_none], obj.get("tamperResistence"))
module_channel = from_union([from_int, from_none], obj.get("moduleChannel"))
double_zone_cfg_enable = from_union([from_bool, from_none], obj.get("doubleZoneCfgEnable"))
access_module_type = from_union([AccessModuleType, from_none], obj.get("accessModuleType"))
try:
access_module_type = from_union([AccessModuleType, from_none], obj.get("accessModuleType"))
except:
_LOGGER.warning("Invalid accessModuleType %s", obj.get("accessModuleType"))
_LOGGER.warning("Zone config: %s", obj)
access_module_type = None
delay_time = from_union([from_int, from_none], obj.get("delayTime"))
timeout_limit = from_union([from_bool, from_none], obj.get("timeoutLimit"))
check_time = from_union([from_int, from_none], obj.get("checkTime"))
Expand Down

0 comments on commit 2964f46

Please sign in to comment.