@@ -32,7 +32,8 @@ class ReadExceptionStatusRequest(ModbusPDU):
3232
3333 def __init__ (self , slave = None , transaction = 0 , skip_encode = 0 ):
3434 """Initialize a new instance."""
35- ModbusPDU .__init__ (self , slave , transaction , skip_encode )
35+ super ().__init__ ()
36+ super ().setData (slave , transaction , skip_encode )
3637
3738 def encode (self ):
3839 """Encode the message."""
@@ -74,7 +75,8 @@ def __init__(self, status=0x00, slave=1, transaction=0, skip_encode=False):
7475
7576 :param status: The status response to report
7677 """
77- ModbusPDU .__init__ (self , slave , transaction , skip_encode )
78+ super ().__init__ ()
79+ super ().setData (slave , transaction , skip_encode )
7880 self .status = status if status < 256 else 255
7981
8082 def encode (self ):
@@ -131,7 +133,8 @@ class GetCommEventCounterRequest(ModbusPDU):
131133
132134 def __init__ (self , slave = 1 , transaction = 0 , skip_encode = False ):
133135 """Initialize a new instance."""
134- ModbusPDU .__init__ (self , slave , transaction , skip_encode )
136+ super ().__init__ ()
137+ super ().setData (slave , transaction , skip_encode )
135138
136139 def encode (self ):
137140 """Encode the message."""
@@ -174,7 +177,8 @@ def __init__(self, count=0x0000, slave=1, transaction=0, skip_encode=False):
174177
175178 :param count: The current event counter value
176179 """
177- ModbusPDU .__init__ (self , slave , transaction , skip_encode )
180+ super ().__init__ ()
181+ super ().setData (slave , transaction , skip_encode )
178182 self .count = count
179183 self .status = True # this means we are ready, not waiting
180184
@@ -236,7 +240,8 @@ class GetCommEventLogRequest(ModbusPDU):
236240
237241 def __init__ (self , slave = 1 , transaction = 0 , skip_encode = False ):
238242 """Initialize a new instance."""
239- ModbusPDU .__init__ (self , slave , transaction , skip_encode )
243+ super ().__init__ ()
244+ super ().setData (slave , transaction , skip_encode )
240245
241246 def encode (self ):
242247 """Encode the message."""
@@ -289,7 +294,8 @@ def __init__(self, status=True, message_count=0, event_count=0, events=None, sla
289294 :param event_count: The current event count
290295 :param events: The collection of events to send
291296 """
292- ModbusPDU .__init__ (self , slave , transaction , skip_encode )
297+ super ().__init__ ()
298+ super ().setData (slave , transaction , skip_encode )
293299 self .status = status
294300 self .message_count = message_count
295301 self .event_count = event_count
@@ -361,7 +367,8 @@ def __init__(self, slave=1, transaction=0, skip_encode=False):
361367 :param slave: Modbus slave slave ID
362368
363369 """
364- ModbusPDU .__init__ (self , slave , transaction , skip_encode )
370+ super ().__init__ ()
371+ super ().setData (slave , transaction , skip_encode )
365372
366373 def encode (self ):
367374 """Encode the message."""
@@ -420,7 +427,8 @@ def __init__(self, identifier=b"\x00", status=True, slave=1, transaction=0, skip
420427 :param identifier: The identifier of the slave
421428 :param status: The status response to report
422429 """
423- ModbusPDU .__init__ (self , slave , transaction , skip_encode )
430+ super ().__init__ ()
431+ super ().setData (slave , transaction , skip_encode )
424432 self .identifier = identifier
425433 self .status = status
426434 self .byte_count = None
0 commit comments