diff --git a/smartmeter/webif/__init__.py b/smartmeter/webif/__init__.py index 1a39ac774..b76a241b5 100644 --- a/smartmeter/webif/__init__.py +++ b/smartmeter/webif/__init__.py @@ -28,6 +28,7 @@ import time import os import json +import pprint from lib.item import Items from lib.model.smartplugin import SmartPluginWebIf @@ -74,7 +75,8 @@ def index(self, reload=None): return tmpl.render(p=self.plugin, webif_pagelength=pagelength, items=self.plugin.get_item_list(), - item_count=len(self.plugin.get_item_list())) + item_count=len(self.plugin.get_item_list()), + ) @cherrypy.expose def get_data_html(self, dataSet=None): @@ -120,7 +122,7 @@ def get_data_html(self, dataSet=None): @cherrypy.expose def submit(self, cmd=None): - self.logger.warning(f"submit: {cmd=}") + self.logger.debug(f"submit: {cmd=}") result = None if cmd == "detect": @@ -129,7 +131,8 @@ def submit(self, cmd=None): elif cmd == 'query': result = self.plugin.query(assign_values=False) - self.logger.warning(f"submit: {result=}") + elif cmd == 'create_items': + result = self.plugin.create_items() if result is not None: # JSON zurücksenden @@ -140,3 +143,4 @@ def submit(self, cmd=None): @cherrypy.expose def read_data(self): self.plugin.query(assign_values=False) + diff --git a/smartmeter/webif/templates/index.html b/smartmeter/webif/templates/index.html index 9577a258c..5abb89cdc 100644 --- a/smartmeter/webif/templates/index.html +++ b/smartmeter/webif/templates/index.html @@ -70,6 +70,46 @@ Additional script tag for plugin specific javascript code go into this block --> {% block pluginscripts %} + + + +