44values for the servers and clients.
55"""
66
7+ INTERNAL_ERROR = "Pymodbus internal error"
78
8- from pymodbus .interfaces import Singleton
99
10-
11- class Defaults (Singleton ): # pylint: disable=too-few-public-methods
10+ class Defaults : # pylint: disable=too-few-public-methods
1211 """A collection of modbus default values.
1312
1413 .. attribute:: Port
@@ -155,8 +154,12 @@ class Defaults(Singleton): # pylint: disable=too-few-public-methods
155154 ReconnectDelayMax = 1000 * 60 * 5
156155 Count = 1
157156
157+ def __init__ (self ):
158+ """Prohibit objects."""
159+ raise RuntimeError (INTERNAL_ERROR )
160+
158161
159- class ModbusStatus ( Singleton ) : # pylint: disable=too-few-public-methods
162+ class ModbusStatus : # pylint: disable=too-few-public-methods
160163 """These represent various status codes in the modbus protocol.
161164
162165 .. attribute:: Waiting
@@ -193,8 +196,12 @@ class ModbusStatus(Singleton): # pylint: disable=too-few-public-methods
193196 SlaveOn = 0xFF
194197 SlaveOff = 0x00
195198
199+ def __init__ (self ):
200+ """Prohibit objects."""
201+ raise RuntimeError (INTERNAL_ERROR )
196202
197- class Endian (Singleton ): # pylint: disable=too-few-public-methods
203+
204+ class Endian : # pylint: disable=too-few-public-methods
198205 """An enumeration representing the various byte endianness.
199206
200207 .. attribute:: Auto
@@ -218,8 +225,12 @@ class Endian(Singleton): # pylint: disable=too-few-public-methods
218225 Big = ">"
219226 Little = "<"
220227
228+ def __init__ (self ):
229+ """Prohibit objects."""
230+ raise RuntimeError (INTERNAL_ERROR )
231+
221232
222- class ModbusPlusOperation ( Singleton ) : # pylint: disable=too-few-public-methods
233+ class ModbusPlusOperation : # pylint: disable=too-few-public-methods
223234 """Represents the type of modbus plus request.
224235
225236 .. attribute:: GetStatistics
@@ -236,8 +247,12 @@ class ModbusPlusOperation(Singleton): # pylint: disable=too-few-public-methods
236247 GetStatistics = 0x0003
237248 ClearStatistics = 0x0004
238249
250+ def __init__ (self ):
251+ """Prohibit objects."""
252+ raise RuntimeError (INTERNAL_ERROR )
239253
240- class DeviceInformation (Singleton ): # pylint: disable=too-few-public-methods
254+
255+ class DeviceInformation : # pylint: disable=too-few-public-methods
241256 """Represents what type of device information to read.
242257
243258 .. attribute:: Basic
@@ -269,8 +284,12 @@ class DeviceInformation(Singleton): # pylint: disable=too-few-public-methods
269284 Extended = 0x03
270285 Specific = 0x04
271286
287+ def __init__ (self ):
288+ """Prohibit objects."""
289+ raise RuntimeError (INTERNAL_ERROR )
290+
272291
273- class MoreData ( Singleton ) : # pylint: disable=too-few-public-methods
292+ class MoreData : # pylint: disable=too-few-public-methods
274293 """Represents the more follows condition.
275294
276295 .. attribute:: Nothing
@@ -285,6 +304,10 @@ class MoreData(Singleton): # pylint: disable=too-few-public-methods
285304 Nothing = 0x00
286305 KeepReading = 0xFF
287306
307+ def __init__ (self ):
308+ """Prohibit objects."""
309+ raise RuntimeError (INTERNAL_ERROR )
310+
288311
289312# ---------------------------------------------------------------------------#
290313# Exported Identifiers
0 commit comments