Bugfix
authorBenjamin Braatz <benjamin.braatz@graph-it.com>
Wed, 3 Feb 2021 09:20:58 +0000 (10:20 +0100)
committerBenjamin Braatz <benjamin.braatz@graph-it.com>
Wed, 3 Feb 2021 09:20:58 +0000 (10:20 +0100)
gmodbus/hitachi.py
schaltschrank/config.py
schaltschrank/websocket.py

index 4aa6c95b56609af088d398ab73bff614c71aeda5..ef9374e438ca8121d6355323e4ec7e02dc613457 100644 (file)
@@ -116,6 +116,8 @@ SJP1FU_REGISTERS = {
     'rw': 'rw',
     'type': 'uint16',
     'conf': {
+      'min': 0,
+      'max': 50,
       'unit': 'A',
       'scale': 0.1,
     },
index c3b30b2274d1889017cda87166d0c71b5a21ffbf..b042fe96227ec17cd27cf24183e13e79b1ddf7cf 100644 (file)
@@ -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)
index 4ec8ab6c37355b9e32d423053ec82abbc63f0f81..a118dca8657725484ebb75400ab7a344391cab4d 100644 (file)
@@ -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