diff --git a/main.py b/main.py index 0d894f4902ad197bb43630d0dea91ef543ab01c6..3d8c78569dd31fc2769802c5822ff9987931205c 100644 --- a/main.py +++ b/main.py @@ -128,6 +128,14 @@ async def update_module_config(config: Conf): fd.write(xml) return +@app.get("/modules/{module}/config/reset") +async def reset_module_config(module:str): + with open("xml_configs/"+module+"_conf_default.xml", encoding='utf8') as fd: + config = json.dumps(xmltodict.parse(fd.read())) + with open("xml_configs/"+module+"_conf.xml", "w") as fd: + fd.write(config) + return + @app.get("/graph/") async def get_plotData(): plotData = {}