From 5c308e9547f80c0247530253d7d95ff668bee0d0 Mon Sep 17 00:00:00 2001 From: Pergola Fabio Date: Mon, 2 Oct 2023 22:25:35 +0200 Subject: [PATCH] fix for indoor raiseerror --- hikvision-doorbell/src/doorbell.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hikvision-doorbell/src/doorbell.py b/hikvision-doorbell/src/doorbell.py index 55c07d1..2f0b1e6 100644 --- a/hikvision-doorbell/src/doorbell.py +++ b/hikvision-doorbell/src/doorbell.py @@ -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: @@ -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") @@ -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")