From 2ab8793238277a0fc2be141fd9642361c1674491 Mon Sep 17 00:00:00 2001 From: Gabriele Favalessa Date: Sat, 14 Dec 2024 14:43:20 +0100 Subject: [PATCH] Allow slave id to be zero --- modbus_cli/modbus_tcp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modbus_cli/modbus_tcp.py b/modbus_cli/modbus_tcp.py index 4d9724f..0709435 100644 --- a/modbus_cli/modbus_tcp.py +++ b/modbus_cli/modbus_tcp.py @@ -9,7 +9,7 @@ class ModbusTcp: def __init__(self, host, port, slave_id, timeout): self.host = host self.port = port - if not slave_id: + if slave_id is None: slave_id = 255 self.slave_id = slave_id self.timeout = timeout