slight c2r.py adaption
This commit is contained in:
parent
15d521e6b4
commit
9af9397324
19
bin/c2r.py
19
bin/c2r.py
@ -3,23 +3,6 @@
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
s = """homeassistant: false
|
|
||||||
permit_join: false
|
|
||||||
mqtt:
|
|
||||||
base_topic: zigbee/gfw
|
|
||||||
server: mqtt://mqtt
|
|
||||||
user: smarthome
|
|
||||||
password: Tc1IsZENNnSldRu8CGA6
|
|
||||||
serial:
|
|
||||||
port: /dev/ttyACM0
|
|
||||||
advanced:
|
|
||||||
ikea_ota_use_test_url: true
|
|
||||||
legacy_api: false
|
|
||||||
log_level: debug
|
|
||||||
channel: 15
|
|
||||||
homeassistant_legacy_entity_attributes: false
|
|
||||||
legacy_availability_payload: false
|
|
||||||
"""
|
|
||||||
try:
|
try:
|
||||||
src_file = sys.argv[1]
|
src_file = sys.argv[1]
|
||||||
dst_file = sys.argv[2]
|
dst_file = sys.argv[2]
|
||||||
@ -34,7 +17,7 @@ except (PermissionError, FileNotFoundError) as e:
|
|||||||
print("Unable to open", '"' + src_file + '"')
|
print("Unable to open", '"' + src_file + '"')
|
||||||
sys.exit(18)
|
sys.exit(18)
|
||||||
|
|
||||||
n = re.sub('^.*server: .*', ' server: <mqtt_smarthome_hostname>', s, flags=re.MULTILINE)
|
n = re.sub('^.*server: .*', ' server: mqtt://<mqtt_smarthome_hostname>', s, flags=re.MULTILINE)
|
||||||
n = re.sub('^.*user: .*', ' user: <mqtt_smarthome_username>', n, flags=re.MULTILINE)
|
n = re.sub('^.*user: .*', ' user: <mqtt_smarthome_username>', n, flags=re.MULTILINE)
|
||||||
n = re.sub('^.*password: .*', ' password: <mqtt_smarthome_password>', n, flags=re.MULTILINE)
|
n = re.sub('^.*password: .*', ' password: <mqtt_smarthome_password>', n, flags=re.MULTILINE)
|
||||||
n = re.sub('^.*auth_token: .*', ' auth_token: <zigbee_auth_token>', n, flags=re.MULTILINE)
|
n = re.sub('^.*auth_token: .*', ' auth_token: <zigbee_auth_token>', n, flags=re.MULTILINE)
|
||||||
|
@ -2,7 +2,7 @@ homeassistant: false
|
|||||||
permit_join: false
|
permit_join: false
|
||||||
mqtt:
|
mqtt:
|
||||||
base_topic: zigbee/gfw
|
base_topic: zigbee/gfw
|
||||||
server: <mqtt_smarthome_hostname>
|
server: mqtt://<mqtt_smarthome_hostname>
|
||||||
user: <mqtt_smarthome_username>
|
user: <mqtt_smarthome_username>
|
||||||
password: <mqtt_smarthome_password>
|
password: <mqtt_smarthome_password>
|
||||||
serial:
|
serial:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user