MODBUS: Fix saving of websettings. svghmi
authorEdouard Tisserant
Fri, 11 Sep 2020 13:46:41 +0200
branchsvghmi
changeset 3054 b4a84892e369
parent 3053 bff50b7e50ee
child 3055 6dd617cc9c05
MODBUS: Fix saving of websettings.
modbus/web_settings.py
--- a/modbus/web_settings.py	Thu Sep 10 16:08:26 2020 +0200
+++ b/modbus/web_settings.py	Fri Sep 11 13:46:41 2020 +0200
@@ -228,7 +228,7 @@
         # This allows us to confirm the saved data contains the correct addr_type
         # when loading from file
         save_info = {}
-        save_info["addr_type"] = ["addr_type"]
+        save_info["addr_type"] = WebNode_entry["addr_type"]
         save_info["node_type"] = WebNode_entry["node_type"]
         save_info["config"   ] = newConfig
         
@@ -262,7 +262,7 @@
     filename = _WebNodeList[WebNode_id]["filename"]
     try:
         #if os.path.isfile(filename):
-        save_info = json.load(open(filename))
+        save_info = json.load(open(os.path.realpath(filename)))
     except Exception:    
         return None