slight c2r.py adaption

This commit is contained in:
Dirk Alders 2023-10-08 18:11:44 +02:00
parent 15d521e6b4
commit 9af9397324
2 changed files with 2 additions and 19 deletions

View File

@ -3,23 +3,6 @@
import re
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:
src_file = sys.argv[1]
dst_file = sys.argv[2]
@ -34,7 +17,7 @@ except (PermissionError, FileNotFoundError) as e:
print("Unable to open", '"' + src_file + '"')
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('^.*password: .*', ' password: <mqtt_smarthome_password>', n, flags=re.MULTILINE)
n = re.sub('^.*auth_token: .*', ' auth_token: <zigbee_auth_token>', n, flags=re.MULTILINE)

View File

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