瀏覽代碼

New config to template (jinja) c2r.py

master
Dirk Alders 9 月之前
父節點
當前提交
938b407513
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4
    4
      bin/c2r.py

+ 4
- 4
bin/c2r.py 查看文件

@@ -17,10 +17,10 @@ except (PermissionError, FileNotFoundError) as e:
17 17
     print("Unable to open", '"' + src_file + '"')
18 18
     sys.exit(18)
19 19
 
20
-n = re.sub('^.*server: .*', '  server: mqtt://<mqtt_smarthome_hostname>', s, flags=re.MULTILINE)
21
-n = re.sub('^.*user: .*', '  user: <mqtt_smarthome_username>', n, flags=re.MULTILINE)
22
-n = re.sub('^.*password: .*', '  password: <mqtt_smarthome_password>', n, flags=re.MULTILINE)
23
-n = re.sub('^.*auth_token: .*', '  auth_token: <zigbee_auth_token>', n, flags=re.MULTILINE)
20
+n = re.sub('^.*server: .*', '  server: mqtt://{{ smart_sat_zigbee2mqtt_hostname }}', s, flags=re.MULTILINE)
21
+n = re.sub('^.*user: .*', '  user: {{ smart_sat_zigbee2mqtt_username }}', n, flags=re.MULTILINE)
22
+n = re.sub('^.*password: .*', '  password: {{ smart_sat_zigbee2mqtt_password  }}', n, flags=re.MULTILINE)
23
+n = re.sub('^.*auth_token: .*', '  auth_token: {{ smart_sat_zigbee2mqtt_auth_token }}', n, flags=re.MULTILINE)
24 24
 
25 25
 try:
26 26
     with open(dst_file, 'w') as fh:

Loading…
取消
儲存