From 1e1e6b278e40cdd605b05e997f0c042e13e0ec39 Mon Sep 17 00:00:00 2001 From: Onkel Andy Date: Sat, 16 Sep 2023 16:23:36 +0200 Subject: [PATCH] stateengine plugin: fix previous implementation --- stateengine/StateEngineFunctions.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/stateengine/StateEngineFunctions.py b/stateengine/StateEngineFunctions.py index c8bff7d0e..a8df0f13e 100755 --- a/stateengine/StateEngineFunctions.py +++ b/stateengine/StateEngineFunctions.py @@ -97,6 +97,7 @@ def check_include_exclude(entry_type): return returnvalue elog.info("{0}: not matching", e) elog.decrease_indent() + return None item = self.itemsApi.return_item(item_id) if item is None: @@ -139,16 +140,23 @@ def check_include_exclude(entry_type): return retval_no_trigger if "se_manual_on" in item.conf: - check_include_exclude("on") + returnvalue = check_include_exclude("on") + if returnvalue is not None: + return returnvalue if "se_manual_exclude" in item.conf: - check_include_exclude("exclude") + returnvalue = check_include_exclude("exclude") + if returnvalue is not None: + return returnvalue if "se_manual_include" in item.conf: - check_include_exclude("include") - # Current value not in list -> Return "No Trigger - elog.info("No include values matching. Writing value {0}", retval_no_trigger) - return retval_no_trigger + returnvalue = check_include_exclude("include") + if returnvalue is not None: + return returnvalue + else: + # Current value not in list -> Return "No Trigger + elog.info("No include values matching. Writing value {0}", retval_no_trigger) + return retval_no_trigger else: # No include-entries -> return "Trigger" elog.info("No include limitation. Writing value {0}", retval_trigger)