Smaller updates

This commit is contained in:
Schemen
2021-02-17 18:03:24 +01:00
parent 5cb64e377a
commit fdb8a72a0d
2 changed files with 25 additions and 2 deletions

View File

@@ -1,9 +1,31 @@
# airthings-influxdb
## Install
```x-sh
git clone ssh://git@git.ponz.io:10022/elia/airthings-influxdb.git && cd airthings-influxdb
virtualenv venv -p python3
source venv/bin/activate
pip install -r requirements.txt
deactivate
# configure your config.ini
cp config.ini.example config.ini
```
## Usage
```
source venv/bin/activate
./airthings-influxdb.py
Usage: airthings-influxdb.py [OPTIONS] COMMAND [ARGS]...
Options:
--debug / --no-debug
-c, --config TEXT give config file
--help Show this message and exit.
Commands:
identify Lists available sensors nearby
start
verify verify your configuration
```

View File

@@ -22,15 +22,16 @@ def read_config(file):
@click.option('-c', '--config', default="config.ini", help='give config file')
@click.pass_context
def cli(ctx, debug, config):
click.echo('Debug mode is %s' % ('on' if debug else 'off'))
ctx.ensure_object(dict)
ctx.obj['DEBUG'] = debug
ctx.obj['CONFIG'] = config
if debug:
click.echo("Debug is enabled")
@cli.command()
@click.pass_context
def verify(ctx):
"""verify your configuration"""
"""verify your configuration - does not do much yet!"""
config = read_config(ctx.obj['CONFIG'])
influx_host = env.get("InfluxdbHost", config['DEFAULT']['InfluxdbHost'])