Skip to content

Commit

Permalink
stateengine plugin: urgent fix of previously introduced issue when ch…
Browse files Browse the repository at this point in the history
…ecking conditionsets for actions
  • Loading branch information
onkelandy committed Aug 21, 2023
1 parent 169edcf commit 416dc41
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions stateengine/StateEngineAction.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,18 @@ def _update_repeat_webif(value: bool):
self._log_info("Action '{0}': Preparing", self._name)
if not self._can_execute(state):
return
current_condition_met, conditions_met, condition_necessary = _check_condition('conditionset')
conditions_met += conditions_met
condition_necessary += condition_necessary
previous_condition_met, conditions_met, condition_necessary = _check_condition('previousconditionset')
conditions_met += conditions_met
condition_necessary += condition_necessary
previousstate_condition_met, conditions_met, condition_necessary = _check_condition('previousstate_conditionset')
conditions_met += conditions_met
condition_necessary += condition_necessary
conditions_met = 0
condition_necessary = 0
current_condition_met, cur_conditions_met, cur_condition_necessary = _check_condition('conditionset')
conditions_met += cur_conditions_met
condition_necessary += cur_condition_necessary
previous_condition_met, prev_conditions_met, prev_condition_necessary = _check_condition('previousconditionset')
conditions_met += prev_conditions_met
condition_necessary += prev_condition_necessary
previousstate_condition_met, prevst_conditions_met, prevst_condition_necessary = _check_condition('previousstate_conditionset')
conditions_met += prevst_conditions_met
condition_necessary += prevst_condition_necessary
self._log_develop("Action '{0}': conditions met: {1}, necessary {2}.", self._name, conditions_met, condition_necessary)
if conditions_met < condition_necessary:
self._log_info("Action '{0}': Skipping because not all conditions are met.", self._name)
return
Expand Down

0 comments on commit 416dc41

Please sign in to comment.