@@ -21,14 +21,14 @@ class ReadBitsRequestBase(ModbusRequest):
21
21
22
22
_rtu_frame_size = 8
23
23
24
- def __init__ (self , address , count , slave = 0 , ** kwargs ):
24
+ def __init__ (self , address , count , slave = 0 , transaction = 0 , protocol = 0 , skip_encode = False , ** _kwargs ):
25
25
"""Initialize the read request data.
26
26
27
27
:param address: The start address to read from
28
28
:param count: The number of bits after "address" to read
29
29
:param slave: Modbus slave slave ID
30
30
"""
31
- ModbusRequest .__init__ (self , slave , ** kwargs )
31
+ ModbusRequest .__init__ (self , slave , transaction , protocol , skip_encode )
32
32
self .address = address
33
33
self .count = count
34
34
@@ -75,13 +75,13 @@ class ReadBitsResponseBase(ModbusResponse):
75
75
76
76
_rtu_byte_count_pos = 2
77
77
78
- def __init__ (self , values , slave = 0 , ** kwargs ):
78
+ def __init__ (self , values , slave = 0 , transaction = 0 , protocol = 0 , skip_encode = False , ** _kwargs ):
79
79
"""Initialize a new instance.
80
80
81
81
:param values: The requested values to be returned
82
82
:param slave: Modbus slave slave ID
83
83
"""
84
- ModbusResponse .__init__ (self , slave , ** kwargs )
84
+ ModbusResponse .__init__ (self , slave , transaction , protocol , skip_encode )
85
85
86
86
#: A list of booleans representing bit values
87
87
self .bits = values or []
@@ -146,14 +146,14 @@ class ReadCoilsRequest(ReadBitsRequestBase):
146
146
function_code = 1
147
147
function_code_name = "read_coils"
148
148
149
- def __init__ (self , address = None , count = None , slave = 0 , ** kwargs ):
149
+ def __init__ (self , address = None , count = None , slave = 0 , transaction = 0 , protocol = 0 , skip_encode = False , ** _kwargs ):
150
150
"""Initialize a new instance.
151
151
152
152
:param address: The address to start reading from
153
153
:param count: The number of bits to read
154
154
:param slave: Modbus slave slave ID
155
155
"""
156
- ReadBitsRequestBase .__init__ (self , address , count , slave , ** kwargs )
156
+ ReadBitsRequestBase .__init__ (self , address , count , slave , transaction , protocol , skip_encode )
157
157
158
158
async def execute (self , context ):
159
159
"""Run a read coils request against a datastore.
@@ -193,13 +193,13 @@ class ReadCoilsResponse(ReadBitsResponseBase):
193
193
194
194
function_code = 1
195
195
196
- def __init__ (self , values = None , slave = 0 , ** kwargs ):
196
+ def __init__ (self , values = None , slave = 0 , transaction = 0 , protocol = 0 , skip_encode = False , ** _kwargs ):
197
197
"""Initialize a new instance.
198
198
199
199
:param values: The request values to respond with
200
200
:param slave: Modbus slave slave ID
201
201
"""
202
- ReadBitsResponseBase .__init__ (self , values , slave , ** kwargs )
202
+ ReadBitsResponseBase .__init__ (self , values , slave , transaction , protocol , skip_encode )
203
203
204
204
205
205
class ReadDiscreteInputsRequest (ReadBitsRequestBase ):
@@ -214,14 +214,14 @@ class ReadDiscreteInputsRequest(ReadBitsRequestBase):
214
214
function_code = 2
215
215
function_code_name = "read_discrete_input"
216
216
217
- def __init__ (self , address = None , count = None , slave = 0 , ** kwargs ):
217
+ def __init__ (self , address = None , count = None , slave = 0 , transaction = 0 , protocol = 0 , skip_encode = False , ** _kwargs ):
218
218
"""Initialize a new instance.
219
219
220
220
:param address: The address to start reading from
221
221
:param count: The number of bits to read
222
222
:param slave: Modbus slave slave ID
223
223
"""
224
- ReadBitsRequestBase .__init__ (self , address , count , slave , ** kwargs )
224
+ ReadBitsRequestBase .__init__ (self , address , count , slave , transaction , protocol , skip_encode )
225
225
226
226
async def execute (self , context ):
227
227
"""Run a read discrete input request against a datastore.
@@ -261,10 +261,10 @@ class ReadDiscreteInputsResponse(ReadBitsResponseBase):
261
261
262
262
function_code = 2
263
263
264
- def __init__ (self , values = None , slave = 0 , ** kwargs ):
264
+ def __init__ (self , values = None , slave = 0 , transaction = 0 , protocol = 0 , skip_encode = False , ** _kwargs ):
265
265
"""Initialize a new instance.
266
266
267
267
:param values: The request values to respond with
268
268
:param slave: Modbus slave slave ID
269
269
"""
270
- ReadBitsResponseBase .__init__ (self , values , slave , ** kwargs )
270
+ ReadBitsResponseBase .__init__ (self , values , slave , transaction , protocol , skip_encode )
0 commit comments