MODBUS: Fix saving of websettings.
authorEdouard Tisserant
Fri, 11 Sep 2020 13:46:41 +0200
changeset 2690 4de6a587f7f9
parent 2689 7f67a7f6bfcc
child 2691 6e4a95621080
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