|
@@ -3,23 +3,6 @@
|
3
|
3
|
import re
|
4
|
4
|
import sys
|
5
|
5
|
|
6
|
|
-s = """homeassistant: false
|
7
|
|
-permit_join: false
|
8
|
|
-mqtt:
|
9
|
|
- base_topic: zigbee/gfw
|
10
|
|
- server: mqtt://mqtt
|
11
|
|
- user: smarthome
|
12
|
|
- password: Tc1IsZENNnSldRu8CGA6
|
13
|
|
-serial:
|
14
|
|
- port: /dev/ttyACM0
|
15
|
|
-advanced:
|
16
|
|
- ikea_ota_use_test_url: true
|
17
|
|
- legacy_api: false
|
18
|
|
- log_level: debug
|
19
|
|
- channel: 15
|
20
|
|
- homeassistant_legacy_entity_attributes: false
|
21
|
|
- legacy_availability_payload: false
|
22
|
|
-"""
|
23
|
6
|
try:
|
24
|
7
|
src_file = sys.argv[1]
|
25
|
8
|
dst_file = sys.argv[2]
|
|
@@ -34,7 +17,7 @@ except (PermissionError, FileNotFoundError) as e:
|
34
|
17
|
print("Unable to open", '"' + src_file + '"')
|
35
|
18
|
sys.exit(18)
|
36
|
19
|
|
37
|
|
-n = re.sub('^.*server: .*', ' server: <mqtt_smarthome_hostname>', s, flags=re.MULTILINE)
|
|
20
|
+n = re.sub('^.*server: .*', ' server: mqtt://<mqtt_smarthome_hostname>', s, flags=re.MULTILINE)
|
38
|
21
|
n = re.sub('^.*user: .*', ' user: <mqtt_smarthome_username>', n, flags=re.MULTILINE)
|
39
|
22
|
n = re.sub('^.*password: .*', ' password: <mqtt_smarthome_password>', n, flags=re.MULTILINE)
|
40
|
23
|
n = re.sub('^.*auth_token: .*', ' auth_token: <zigbee_auth_token>', n, flags=re.MULTILINE)
|