|
18 | 18 | ModbusTlsFramer, |
19 | 19 | ) |
20 | 20 |
|
| 21 | + |
21 | 22 | _logger = logging.getLogger(__name__) |
22 | 23 |
|
23 | 24 | DGRAM_TYPE = socket.SOCK_DGRAM |
@@ -236,7 +237,7 @@ def __init__(self, protocol_class=None, framer=None, **kwargs): |
236 | 237 |
|
237 | 238 | :param protocol_class: Protocol used to talk to modbus device. |
238 | 239 | """ |
239 | | - # If there are no loop running a runtime error will be raised |
| 240 | + # get current loop, if there are no loop a RuntimeError will be raised |
240 | 241 | self.loop = asyncio.get_running_loop() |
241 | 242 | #: Protocol used to talk to modbus device. |
242 | 243 | self.protocol_class = protocol_class or ModbusClientProtocol |
@@ -347,17 +348,15 @@ def __init__(self, host=None, port=502, protocol_class=None, framer=None, **kwar |
347 | 348 | :param port: Port to connect |
348 | 349 | :param protocol_class: Protocol used to talk to modbus device. |
349 | 350 | """ |
350 | | - # If there are no loop running a runtime error will be raised |
| 351 | + # get current loop, if there are no loop a RuntimeError will be raised |
351 | 352 | self.loop = asyncio.get_running_loop() |
352 | 353 | #: Protocol used to talk to modbus device. |
353 | 354 | self.protocol_class = protocol_class or ModbusClientProtocol |
354 | 355 | #: Current protocol instance. |
355 | 356 | self.protocol = None |
356 | 357 | self.framer = framer if framer else ModbusSocketFramer |
357 | | - |
358 | 358 | self.host = host |
359 | 359 | self.port = port |
360 | | - |
361 | 360 | self.connected = False |
362 | 361 | self._proto_args = kwargs |
363 | 362 |
|
@@ -422,7 +421,7 @@ def __init__(self, protocol_class=None, framer=None, **kwargs): |
422 | 421 |
|
423 | 422 | :param protocol_class: Protocol used to talk to modbus device. |
424 | 423 | """ |
425 | | - # If there are no loop running a runtime error will be raised |
| 424 | + # get current loop, if there are no loop a RuntimeError will be raised |
426 | 425 | self.loop = asyncio.get_running_loop() |
427 | 426 | self.framer = framer if framer else ModbusTlsFramer |
428 | 427 | self.server_hostname = None |
@@ -493,7 +492,7 @@ def __init__(self, protocol_class=None, framer=None, **kwargs): |
493 | 492 |
|
494 | 493 | :param protocol_class: Protocol used to talk to modbus device. |
495 | 494 | """ |
496 | | - # If there are no loop running a runtime error will be raised |
| 495 | + # get current loop, if there are no loop a RuntimeError will be raised |
497 | 496 | self.loop = asyncio.get_running_loop() |
498 | 497 | #: Protocol used to talk to modbus device. |
499 | 498 | self.protocol_class = protocol_class or ModbusUdpClientProtocol |
@@ -612,7 +611,7 @@ def __init__(self, host=None, port=502, protocol_class=None, framer=None, **kwar |
612 | 611 | :param port: Port to connect |
613 | 612 | :param protocol_class: Protocol used to talk to modbus device. |
614 | 613 | """ |
615 | | - # If there are no loop running a runtime error will be raised |
| 614 | + # get current loop, if there are no loop a RuntimeError will be raised |
616 | 615 | self.loop = asyncio.get_running_loop() |
617 | 616 | #: Protocol used to talk to modbus device. |
618 | 617 | self.protocol_class = protocol_class or ModbusUdpClientProtocol |
@@ -711,7 +710,7 @@ def __init__( |
711 | 710 | :param protocol_class: Protocol used to talk to modbus device. |
712 | 711 | :param framer: Framer to use |
713 | 712 | """ |
714 | | - # If there are no loop running a runtime error will be raised |
| 713 | + # get current loop, if there are no loop a RuntimeError will be raised |
715 | 714 | self.loop = asyncio.get_running_loop() |
716 | 715 | #: Protocol used to talk to modbus device. |
717 | 716 | self.protocol_class = protocol_class or ModbusRtuFramer |
|
0 commit comments