Skip to content

Commit

Permalink
added some extra logging temp for doorbell num
Browse files Browse the repository at this point in the history
  • Loading branch information
pergolafabio committed Sep 10, 2023
1 parent dd031cb commit 8e2ef47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hikvision-doorbell/src/doorbell.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def sdk_device_ability() -> int:
if not result:
raise SDKError(self._sdk, "Error while getting device ability")
response_xml = output_buffer.value.decode('utf-8')
logger.info("Response url for sdk_device_ability: {}", response_xml)

# Parse the XML response
response = ET.fromstring(response_xml)
Expand All @@ -255,7 +256,7 @@ def sdk_device_ability() -> int:

def isapi_io_outputs() -> int:
io_outputs_xml = self._call_isapi("GET", "/ISAPI/System/IO/outputs")

logger.info("Response url for /ISAPI/System/IO/outputs: {}", io_outputs_xml)
root = ET.fromstring(io_outputs_xml)
if 'IOOutputPortList' not in root.tag:
# XML does not contain the required tag
Expand All @@ -265,6 +266,7 @@ def isapi_io_outputs() -> int:
def isapi_remote_control() -> int:
# Device does not support previous ISAPI endpoint, try another
door_capabilities_xml = self._call_isapi("GET", "/ISAPI/AccessControl/RemoteControl/door/capabilities")
logger.info("Response url for /ISAPI/AccessControl/RemoteControl/door/capabilities: {}", door_capabilities_xml)
root = ET.fromstring(door_capabilities_xml)

door_number_element = root.find('{*}doorNo')
Expand Down

0 comments on commit 8e2ef47

Please sign in to comment.