From 3c22dd7209053054646006861750ac34cb9eb85f Mon Sep 17 00:00:00 2001 From: Benjamin Braatz Date: Wed, 3 Feb 2021 10:20:58 +0100 Subject: [PATCH] Bugfix --- gmodbus/hitachi.py | 2 ++ schaltschrank/config.py | 2 +- schaltschrank/websocket.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gmodbus/hitachi.py b/gmodbus/hitachi.py index 4aa6c95..ef9374e 100644 --- a/gmodbus/hitachi.py +++ b/gmodbus/hitachi.py @@ -116,6 +116,8 @@ SJP1FU_REGISTERS = { 'rw': 'rw', 'type': 'uint16', 'conf': { + 'min': 0, + 'max': 50, 'unit': 'A', 'scale': 0.1, }, diff --git a/schaltschrank/config.py b/schaltschrank/config.py index c3b30b2..b042fe9 100644 --- a/schaltschrank/config.py +++ b/schaltschrank/config.py @@ -36,7 +36,7 @@ async def process_configuration(conf, queues): if 'modbus' in conf: modbus_conf = conf['modbus'] #port = SerialPort(modbus_conf['serial device']) - port = serialio.serial_for_url(f"serial://{modbus_conf['serial_device']}") + port = serialio.serial_for_url(f"serial://{modbus_conf['serial device']}") await port.open() client = SerialClient(port, modbus_conf['slave id']) fu = SJP1Fu(client) diff --git a/schaltschrank/websocket.py b/schaltschrank/websocket.py index 4ec8ab6..a118dca 100644 --- a/schaltschrank/websocket.py +++ b/schaltschrank/websocket.py @@ -50,7 +50,7 @@ async def event_handler(websocket, path, pins, fu, queue): event = await queue.get() message = json.dumps(event) await websocket.send(message) - if event['event'] == 'pinstate': and event['changed']: + if event['event'] == 'pinstate' and event['changed']: okay = ( pins['Zentralschmierung'].value and pins['Ölpumpe'].value and pins['Schwungrad'].value and -- 2.34.1