From 3d5fa0dd0ccb3aa288ed7b0e70f68e6839496cea Mon Sep 17 00:00:00 2001 From: ZodiusInfuser Date: Mon, 4 Dec 2023 15:08:18 +0000 Subject: [PATCH] Fix for case where undervoltage error would not trigger --- lib/pimoroni_yukon/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pimoroni_yukon/__init__.py b/lib/pimoroni_yukon/__init__.py index 9e56080..55c1782 100644 --- a/lib/pimoroni_yukon/__init__.py +++ b/lib/pimoroni_yukon/__init__.py @@ -638,7 +638,7 @@ def monitor(self, under_voltage_counter=UNDERVOLTAGE_COUNT_LIMIT): # Under Voltage if voltage_in < self.VOLTAGE_LOWER_LIMIT: self.__undervoltage_count += 1 - if self.__undervoltage_count > under_voltage_counter: + if self.__undervoltage_count > under_voltage_counter or voltage_in < self.VOLTAGE_SHORT_LEVEL: self.disable_main_output() raise UnderVoltageError(f"[Yukon] Input voltage of {voltage_in}V below minimum operating level of {self.VOLTAGE_LOWER_LIMIT}V. Turning off output") else: