From 9c2f50a620e89157a9332cf92ab880b7f8435f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 13 Nov 2020 10:58:27 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=20Properties=20for=20min/max=20on=20C?= =?UTF-8?q?ountedEvent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cc @chendo --- src/octoprint/util/__init__.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index f28f1bff5..288335046 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -1654,6 +1654,24 @@ class CountedEvent(object): self._internal_set(value) + @property + def min(self): + return self._min + + @min.setter + def min(self, val): + with self._mutex: + self._min = val + + @property + def max(self): + return self._max + + @max.setter + def max(self, val): + with self._mutex: + self._max = val + @property def is_set(self): return self._event.is_set