Skip to content

Commit

Permalink
stateengine plugin: fix se_status_eval when using structs (e.g. in se…
Browse files Browse the repository at this point in the history
…_use)
  • Loading branch information
onkelandy committed Jul 5, 2024
1 parent 601ca5b commit b27753f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stateengine/StateEngineCondition.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def check_items(self, check, value=None, item_state=None):
self.__eval = value
eval_value = value
if check == "se_status_eval" or (check == "attribute" and self.__status_eval is None):
if check == "attribute":
value = _orig_value
if value is None:
value = StateEngineTools.find_attribute(self._sh, item_state, "se_status_eval_" + self.__name)
if isinstance(value, str):
Expand Down Expand Up @@ -475,7 +477,6 @@ def __convert(convert_value, convert_current):
self.__updatedbynegate if valuetype == "updatedby" else\
self.__triggeredbynegate if valuetype == "triggeredby" else\
self.__negate

if isinstance(value, list):
text = "Condition '{0}': {1}={2} negate={3} current={4}"
_key = ['{}'.format(state.id), 'conditionsets', '{}'.format(self._abitem.get_variable('current.conditionset_name')), '{}'.format(self.__name), 'current', '{}'.format(valuetype)]
Expand Down

0 comments on commit b27753f

Please sign in to comment.