Move config to dist file to allow pull without conflict

This commit is contained in:
Thomas Dietrich 2017-08-10 19:40:32 +02:00
parent fdbc47384f
commit 69d7852d16
4 changed files with 13 additions and 5 deletions

2
.gitignore vendored
View File

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

View File

@ -59,11 +59,19 @@ cd /opt/miflora-mqtt-daemon
sudo pip3 install -r requirements.txt
```
## Configuration
To match personal needs, all operation details can be configured using the file [`config.ini`](config.ini).
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.dist).
```shell
cp /opt/miflora-mqtt-daemon/config.{ini.bak,ini}
vim /opt/miflora-mqtt-daemon/config.ini
```

View File

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