浏览代码

Move config to dist file to allow pull without conflict

Thomas Dietrich 8 年之前
父节点
当前提交
69d7852d16
共有 4 个文件被更改,包括 11 次插入3 次删除
  1. 1 1
      .gitignore
  2. 9 1
      README.md
  3. 0 0
      config.ini.dist
  4. 1 1
      miflora-mqtt-daemon.py

+ 1 - 1
.gitignore

@@ -1,6 +1,6 @@
 # Project specific
 
-config.local.ini
+config.ini
 
 
 # Created by https://www.gitignore.io/api/python

+ 9 - 1
README.md

@@ -59,11 +59,19 @@ cd /opt/miflora-mqtt-daemon
 sudo pip3 install -r requirements.txt
 ```
 
+The daemon depends on `gatttool`, an external tool provided by the package `bluez` installed just now.
+Make sure gatttool is available on your system by executing the command once:
+
+```shell
+gatttool --help
+```
+
 ## Configuration
 
-To match personal needs, all operation details can be configured using the file [`config.ini`](config.ini).
+To match personal needs, all operation details can be configured using the file [`config.ini`](config.ini.dist).
 
 ```shell
+cp /opt/miflora-mqtt-daemon/config.{ini.bak,ini}
 vim /opt/miflora-mqtt-daemon/config.ini
 ```
 

config.ini → config.ini.dist


+ 1 - 1
miflora-mqtt-daemon.py

@@ -94,7 +94,7 @@ def flores_to_openhab_items(flores, reporting_mode):
 # Load configuration file
 config = ConfigParser(delimiters=('=', ))
 config.optionxform = str
-config.read([os.path.join(sys.path[0], 'config.ini'), os.path.join(sys.path[0], 'config.local.ini')])
+config.read([os.path.join(sys.path[0], 'config.ini.dist'), os.path.join(sys.path[0], 'config.ini')])
 
 reporting_mode = config['General'].get('reporting_method', 'mqtt-json')
 daemon_enabled = config['Daemon'].getboolean('enabled', True)