From d32b1e75d19dc21b736702a71d69c074a3c81fec Mon Sep 17 00:00:00 2001 From: Onkel Andy Date: Tue, 26 Nov 2024 22:17:40 +0100 Subject: [PATCH] stateengine: use sh.items.return_item instead of sh.return_item --- stateengine/StateEngineFunctions.py | 4 ++-- stateengine/StateEngineItem.py | 6 +++--- stateengine/StateEngineTools.py | 2 +- stateengine/webif/__init__.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stateengine/StateEngineFunctions.py b/stateengine/StateEngineFunctions.py index 1e869d033..e714a73c3 100755 --- a/stateengine/StateEngineFunctions.py +++ b/stateengine/StateEngineFunctions.py @@ -97,7 +97,7 @@ def check_include_exclude(entry_type): elog.decrease_indent() return None - item = self.__sh.return_item(item_id) + item = self.__sh.items.return_item(item_id) if item is None: self.logger.error("manual_item_update_eval: item {0} not found!".format(item_id)) @@ -111,7 +111,7 @@ def check_include_exclude(entry_type): if "se_manual_logitem" in item.conf: elog_item_id = item.conf["se_manual_logitem"] - elog_item = self.__sh.return_item(elog_item_id) + elog_item = self.__sh.items.return_item(elog_item_id) if elog_item is None: self.logger.error("manual_item_update_item: se_manual_logitem {0} not found!".format(elog_item_id)) elog = StateEngineLogger.SeLoggerDummy() diff --git a/stateengine/StateEngineItem.py b/stateengine/StateEngineItem.py index b171a8823..d5c255c4b 100755 --- a/stateengine/StateEngineItem.py +++ b/stateengine/StateEngineItem.py @@ -2162,7 +2162,7 @@ def return_item(self, item_id): if isinstance(item_id, (StateEngineStruct.SeStruct, self.__itemClass)): return item_id, None if isinstance(item_id, StateEngineState.SeState): - return self.__sh.return_item(item_id.id), None + return self.__sh.items.return_item(item_id.id), None if item_id is None: _issue = "item_id is None" return None, [_issue] @@ -2203,7 +2203,7 @@ def return_item(self, item_id): self.__logger.warning(_issue) return None, [_issue] else: - item = self.__sh.return_item(item_id) + item = self.__sh.items.return_item(item_id) if item is None: _issue = "Item '{0}' not found.".format(item_id) self.__logger.warning(_issue) @@ -2226,7 +2226,7 @@ def return_item(self, item_id): rel_item_id = item_id[parent_level:] if rel_item_id != "": result += "." + rel_item_id - item = self.__sh.return_item(result) + item = self.__sh.items.return_item(result) if item is None: _issue = "Determined item '{0}' does not exist.".format(item_id) self.__logger.warning(_issue) diff --git a/stateengine/StateEngineTools.py b/stateengine/StateEngineTools.py index b423c9c6a..760d4ca5f 100755 --- a/stateengine/StateEngineTools.py +++ b/stateengine/StateEngineTools.py @@ -410,7 +410,7 @@ def get_original_caller(smarthome, elog, caller, source, item=None, eval_keyword else: original_source = "None" while partition_strip(original_caller, ":")[0] in eval_keyword: - original_item = smarthome.return_item(original_source) + original_item = smarthome.items.return_item(original_source) if original_item is None: elog.info("get_caller({0}, {1}): original item not found", caller, source) break diff --git a/stateengine/webif/__init__.py b/stateengine/webif/__init__.py index 809f8084b..7ed239b98 100755 --- a/stateengine/webif/__init__.py +++ b/stateengine/webif/__init__.py @@ -63,7 +63,7 @@ def index(self, action=None, item_id=None, item_path=None, reload=None, abitem=N :return: contents of the template after beeing rendered """ - item = self.plugin.get_sh().return_item(item_path) + item = self.plugin.get_sh().items.return_item(item_path) tmpl = self.tplenv.get_template('{}.html'.format(page)) pagelength = self.plugin.get_parameter_value('webif_pagelength')