Skip to content

Commit

Permalink
stateengine: use sh.items.return_item instead of sh.return_item
Browse files Browse the repository at this point in the history
  • Loading branch information
onkelandy committed Nov 26, 2024
1 parent dc9a928 commit d32b1e7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions stateengine/StateEngineFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions stateengine/StateEngineItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion stateengine/StateEngineTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stateengine/webif/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit d32b1e7

Please sign in to comment.