Skip to content

Commit

Permalink
removed some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pergolafabio committed Sep 20, 2023
1 parent 85e1215 commit 749d61f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hikvision-doorbell/src/doorbell.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,14 @@ def isapi_remote_control() -> int:

def isapi_device_info() -> int:
electro_lock_xml = self._call_isapi("GET", "/ISAPI/System/deviceInfo")
logger.info("Response url for /ISAPI/System/deviceInfo: {}", electro_lock_xml)
logger.debug("Response url for /ISAPI/System/deviceInfo: {}", electro_lock_xml)
root = ET.fromstring(electro_lock_xml)
electro_lock_xml_element = root.find('{*}electroLockNum')
# Error out if we don't find attribute `max` inside the `doorNo` element
if electro_lock_xml_element is None or electro_lock_xml_element.text is None:
# Print a string representation of the response XML
logger.info("No electro locks found for the outdoor device")
raise RuntimeError('Cannot find `electroLockNum` node in XML response')
logger.info("We have found {} electro locks for the outdoor device", electro_lock_xml_element.text)
logger.debug("We have found {} electro locks for the outdoor device", electro_lock_xml_element.text)
return int(electro_lock_xml_element.text)

# Define the list of available endpoints to try
Expand Down

0 comments on commit 749d61f

Please sign in to comment.