diff --git a/carom/cli.py b/carom/cli.py index d739239..1680d2d 100644 --- a/carom/cli.py +++ b/carom/cli.py @@ -1,11 +1,10 @@ +import logging from signal import pause import click +import click_log import gpiozero from click_didyoumean import DYMGroup -import click_log -import logging - from gpiozero.pins.native import NativeFactory from terminaltables import SingleTable @@ -17,6 +16,7 @@ click_log.basic_config(root_logger) gpiozero.Device.pin_factory = NativeFactory() + @click.group(cls=DYMGroup) @click_log.simple_verbosity_option(root_logger) def cli(): @@ -36,7 +36,6 @@ def get_gpio(): click.echo(st.table) - @cli.command() def get_uuid(): """ @@ -55,6 +54,7 @@ def run(): table.connect() pause() + @cli.command() def check_config(): """ diff --git a/carom/client.ini b/carom/client.ini index c295743..291a1fd 100644 --- a/carom/client.ini +++ b/carom/client.ini @@ -2,13 +2,23 @@ endpoint = https://carom-dev.einsle.de/{0} token = 97a65be7c8f19fb9d3a1b4de2effea958e52ba7a [mapping] -1 = 4 -2 = 17 -3 = 27 -4 = 22 -5 = 10 -6 = 9 -7 = 11 -8 = 5 +## hw rev 1 - 4 +1 = 20 +2 = 16 +3 = 12 +4 = 7 +5 = 8 +6 = 25 +7 = 24 +8 = 18 +## hw rev 5 +#1 = 4 +#2 = 17 +#3 = 27 +#4 = 22 +#5 = 10 +#6 = 9 +#7 = 11 +#8 = 5 [logging] file = /var/log/carom-client.log diff --git a/carom/const.py b/carom/const.py index 8c31c82..08f69ef 100644 --- a/carom/const.py +++ b/carom/const.py @@ -2,5 +2,5 @@ from pkg_resources import resource_string DEFAULT_CONFIG = resource_string(__name__, 'client.ini').decode() """Default configfile, that is used as a Fallback if no other configuration exists.""" -CONFIG_FILES = ('/boot/carom-client.conf', ) +CONFIG_FILES = ('/boot/carom-client.conf',) """Order of resolution of Config Files. Files are tried in order, first one found is used.""" diff --git a/carom/utils.py b/carom/utils.py index 21a5954..60c9ad9 100644 --- a/carom/utils.py +++ b/carom/utils.py @@ -1,14 +1,12 @@ import json -from datetime import datetime import logging - import uuid +from datetime import datetime import requests from carom.config import config - logger = logging.getLogger(__name__) @@ -45,4 +43,5 @@ def send_to_server(state, table): url, data=json.dumps(payload), headers=headers, - ) \ No newline at end of file + verify=False, + )