From 9af939732478a3b18d7c9587b8ccc11729bdc218 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 8 Oct 2023 18:11:44 +0200 Subject: [PATCH] slight c2r.py adaption --- bin/c2r.py | 19 +------------------ config_example/configuration.yaml | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/bin/c2r.py b/bin/c2r.py index b9331b7..9f53bd1 100755 --- a/bin/c2r.py +++ b/bin/c2r.py @@ -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: ', s, flags=re.MULTILINE) +n = re.sub('^.*server: .*', ' server: mqtt://', s, flags=re.MULTILINE) n = re.sub('^.*user: .*', ' user: ', n, flags=re.MULTILINE) n = re.sub('^.*password: .*', ' password: ', n, flags=re.MULTILINE) n = re.sub('^.*auth_token: .*', ' auth_token: ', n, flags=re.MULTILINE) diff --git a/config_example/configuration.yaml b/config_example/configuration.yaml index bae0ae4..47e823b 100644 --- a/config_example/configuration.yaml +++ b/config_example/configuration.yaml @@ -2,7 +2,7 @@ homeassistant: false permit_join: false mqtt: base_topic: zigbee/gfw - server: + server: mqtt:// user: password: serial: