diff --git a/stateengine/StateEngineValue.py b/stateengine/StateEngineValue.py index 73c01acdd..329125021 100755 --- a/stateengine/StateEngineValue.py +++ b/stateengine/StateEngineValue.py @@ -156,7 +156,7 @@ def __resetvalue(self): # value: string indicating value or source of value # name: name of object ("time" is being handled differently) def set(self, value, name="", reset=True, item=None): - #value = copy.deepcopy(value) + value = copy.deepcopy(value) if reset: self.__resetvalue() if isinstance(value, list): diff --git a/stateengine/webif/__init__.py b/stateengine/webif/__init__.py index e5d6f224f..1c3021bc5 100755 --- a/stateengine/webif/__init__.py +++ b/stateengine/webif/__init__.py @@ -103,8 +103,18 @@ def get_data_html(self, dataSet=None): :param dataSet: Dataset for which the data should be returned (standard: None) :return: dict with the data needed to update the web page. """ - - if dataSet and isinstance(dataSet, str): + if dataSet is None: + # get the new data + data = {} + for item in self.plugin.get_items(): + conditionset = item.lastconditionset_name + conditionset = "-" if conditionset == "" else conditionset + data.update({item.id: {'laststate': item.laststate_name, 'lastconditionset': conditionset}}) + try: + return json.dumps(data) + except Exception as e: + self.logger.error(f"get_data_html exception: {e}") + elif dataSet and isinstance(dataSet, str): try: dataSet = self.plugin.abitems[dataSet] except Exception as e: @@ -114,4 +124,6 @@ def get_data_html(self, dataSet=None): if self.vis_enabled and dataSet.firstrun is None: self.plugin.get_graph(dataSet, 'graph') return json.dumps({"success": "true"}) - return json.dumps({"success": "false"}) + return json.dumps({"success": "false"}) + else: + return {}