Skip to content

Commit

Permalink
fix for indoor raiseerror
Browse files Browse the repository at this point in the history
  • Loading branch information
pergolafabio committed Oct 2, 2023
1 parent 41ed626 commit 5c308e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hikvision-doorbell/src/doorbell.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def isapi_door_capabilities() -> int:
if door_number_element is None or door_number_element.text is None:
# Print a string representation of the response XML
logger.debug("No door relays found for the indoor device")
raise RuntimeError(f'Unexpected XML response: {io_doors_xml}')
logger.debug("We have found {} door relays for the indoor device", door_number_element.text)
return int(door_number_element.text)
except ET.ParseError:
Expand All @@ -228,7 +229,7 @@ def isapi_door_capabilities() -> int:
pass

# We have run out of available endpoints to call, dont ro a runtime error, just continue with 0 outputs
logger.info("Unable to get the number of doors, please configure the relays manually with this option in the config: output_relays")
logger.debug("Unable to get the number of doors, please configure the relays manually with this option in the config: output_relays")
return 0
#raise RuntimeError("Unable to get the number of doors, please configure the relays manually with this option in the config: output_relays")

Expand Down Expand Up @@ -349,7 +350,7 @@ def isapi_device_info() -> int:
pass

# We have run out of available endpoints to call
logger.info("Unable to get the number of coms for the indoor station")
logger.debug("Unable to get the number of coms for the indoor station")
return 0
#raise RuntimeError("Unable to get the number of coms")

Expand Down

0 comments on commit 5c308e9

Please sign in to comment.