From 3537c36bc548b4f66043078caaa075d6ce3f5ce4 Mon Sep 17 00:00:00 2001 From: Onkel Andy Date: Wed, 11 Sep 2024 16:11:03 +0200 Subject: [PATCH] stateengine plugin: important fix when logging wrongly defined item for action --- stateengine/StateEngineAction.py | 1 - stateengine/StateEngineActions.py | 4 ++-- stateengine/StateEngineItem.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/stateengine/StateEngineAction.py b/stateengine/StateEngineAction.py index 3a33966c4..a8973b525 100755 --- a/stateengine/StateEngineAction.py +++ b/stateengine/StateEngineAction.py @@ -668,7 +668,6 @@ def complete(self, state, action_type, evals_items=None, use=None): self._abitem.set_variable('current.state_name', state.name) self._action_type = action_type self._state = state - self._item, self._status, self._mindelta, self._value, _issue = self.check_complete( state, self._item, self._status, self._mindelta, self._value, "set/force", evals_items, use) self._action_status = _issue diff --git a/stateengine/StateEngineActions.py b/stateengine/StateEngineActions.py index 06a34d1cc..9c2d44a00 100755 --- a/stateengine/StateEngineActions.py +++ b/stateengine/StateEngineActions.py @@ -529,7 +529,7 @@ def complete(self, state, action_type, evals_items=None, use=None): _status.update(self.__actions[name].complete(state, action_type, evals_items, use)) except ValueError as ex: _status.update({name: {'issue': ex, 'issueorigin': {'state': state.id, 'action': 'unknown'}}}) - raise ValueError("State '{0}', Action '{1}': {2}".format(state.id, name, ex)) + raise ValueError("Completing State '{0}', Action '{1}': {2}".format(state.id, name, ex)) self._log_debug("Completing {} for state {} status {}", self.__actions, state, _status) return _status @@ -538,7 +538,7 @@ def set(self, value): try: self.__actions[name].update(value) except ValueError as ex: - raise ValueError("State '{0}', Action '{1}': {2}".format(value.property.path, name, ex)) + raise ValueError("Setting State '{0}', Action '{1}': {2}".format(value.property.path, name, ex)) # Execute all actions # is_repeat: Indicate if this is a repeated action without changing the state diff --git a/stateengine/StateEngineItem.py b/stateengine/StateEngineItem.py index 4d71e26e0..7c8571cda 100755 --- a/stateengine/StateEngineItem.py +++ b/stateengine/StateEngineItem.py @@ -2131,7 +2131,7 @@ def return_item(self, item_id): _, _, item = item.partition(":") return item, None elif match: - _issue = ("Item '{0}' has to be defined as an item path " + _issue = ("Item '{}' has to be defined as an item path " "or eval expression without {}.").format(match.group(1), item_id) self.__logger.warning(_issue) return None, [_issue]