Kaynağa Gözat

slight c2r.py adaption

master
Dirk Alders 1 yıl önce
ebeveyn
işleme
9af9397324
2 değiştirilmiş dosya ile 2 ekleme ve 19 silme
  1. 1
    18
      bin/c2r.py
  2. 1
    1
      config_example/configuration.yaml

+ 1
- 18
bin/c2r.py Dosyayı Görüntüle

@@ -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)

+ 1
- 1
config_example/configuration.yaml Dosyayı Görüntüle

@@ -2,7 +2,7 @@ homeassistant: false
2 2
 permit_join: false
3 3
 mqtt:
4 4
   base_topic: zigbee/gfw
5
-  server: <mqtt_smarthome_hostname>
5
+  server: mqtt://<mqtt_smarthome_hostname>
6 6
   user: <mqtt_smarthome_username>
7 7
   password: <mqtt_smarthome_password>
8 8
 serial:

Loading…
İptal
Kaydet