Skip to content

Commit

Permalink
lib.item: revert _items_instance.return_item
Browse files Browse the repository at this point in the history
  • Loading branch information
onkelandy committed Oct 20, 2024
1 parent 1787ecd commit c11e5db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/item/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ def _init_prerun(self):

if self._hysteresis_input:
# Only if item has a hysteresis_input attribute
triggering_item = self._sh.return_item(self._hysteresis_input)
triggering_item = _items_instance.return_item(self._hysteresis_input)
if triggering_item is None: # triggering item was not found
logger.error(f"item '{self._path}': trigger item '{self._hysteresis_input}' not found for function 'hysteresis'")
#elif self._hysteresis_upper_threshold < self._hysteresis_lower_threshold:
Expand Down Expand Up @@ -1943,7 +1943,7 @@ def hysteresis_state(self):

upper = self.__run_attribute_eval(self._hysteresis_upper_threshold)
lower = self.__run_attribute_eval(self._hysteresis_lower_threshold)
input_value = self._sh.return_item(self._hysteresis_input)()
input_value = _items_instance.return_item(self._hysteresis_input)()

state = self._get_hysterisis_state_string(lower, upper, input_value, log=self._hysteresis_log, txt='hysteresis_state')

Expand Down Expand Up @@ -1976,7 +1976,7 @@ def hysteresis_data(self):
lower_timer = self._hysteresis_lower_timer
else:
lower_timer = self.__run_attribute_eval(self._hysteresis_lower_timer)
input_value = self._sh.return_item(self._hysteresis_input)()
input_value = _items_instance.return_item(self._hysteresis_input)()

state = self._get_hysterisis_state_string(lower, upper, input_value, log=self._hysteresis_log, txt='hysteresis_data')

Expand Down Expand Up @@ -2135,7 +2135,7 @@ def _run_on_xxx(self, path, value, on_dest, on_eval, attr='?', caller=None, sour
if dest_value is not None:
# expression computes and does not result in None
if on_dest != '':
dest_item = self._sh.return_item(on_dest)
dest_item = _items_instance.return_item(on_dest)
if dest_item is not None:
dest_item.__update(dest_value, caller=attr, source=self._path)
logger.debug(" - : '{}' finally evaluating {} = {}, result={}".format(attr, on_dest, on_eval, dest_value))
Expand Down Expand Up @@ -2219,7 +2219,7 @@ def _log_build_text(self, value, caller, source=None, dest=None):
entry = self._log_rules.get('itemvalue', None)
if entry is not None:
item = self.get_absolutepath(entry.strip().replace("sh.", ""), KEY_LOG_CHANGE)
itemvalue = str(self._sh.return_item(item).property.value)
itemvalue = str(_items_instance.return_item(item).property.value)
else:
itemvalue = None
except Exception as e:
Expand Down Expand Up @@ -2247,7 +2247,7 @@ def convert_entry(entry, to):
try:
# try to get value from item
item = self.get_absolutepath(entry.strip().replace("sh.", ""), KEY_LOG_CHANGE)
returnvalue = self._sh.return_item(item).property.value
returnvalue = _items_instance.return_item(item).property.value
except Exception:
if to == "list":
returnvalue = [entry]
Expand Down

0 comments on commit c11e5db

Please sign in to comment.