26 lines
581 B
Python
26 lines
581 B
Python
LOCALBORKER = "127.0.0.1"
|
|
LOCALPORT = 1883
|
|
DEVICEBORKER = "127.0.0.1"
|
|
DEVICEPORT = 1883
|
|
BORKER = "123.57.81.127"
|
|
PORT = 1888
|
|
USER = "test"
|
|
PWD = "test"
|
|
DEVICENAME = 'TGX-08'
|
|
YSMODE = False
|
|
COREECTMODE = True
|
|
|
|
|
|
|
|
def read_config():
|
|
config = {}
|
|
path = "/home/admin/.config/cpy/config.json"
|
|
with open(path, "r") as f:
|
|
config = json.load(f)
|
|
return config
|
|
return None
|
|
|
|
def save_config(config):
|
|
path = "/home/admin/.config/cpy/config.json"
|
|
with open(path, "w", encoding='utf-8') as f:
|
|
json.dump(config, f, indent=4) |