Update carom client, format code and add hardware mapping from rev 1-4
This commit is contained in:
parent
15e93c127a
commit
5cb7de8c9b
@ -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():
|
||||
"""
|
||||
|
@ -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
|
||||
|
@ -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."""
|
||||
|
@ -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,
|
||||
)
|
||||
verify=False,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user