Smaller updates
This commit is contained in:
22
README.md
22
README.md
@@ -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
|
||||
```
|
||||
|
||||
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user