We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f2c6aa commit 1043cdbCopy full SHA for 1043cdb
pymodbus/datastore/store.py
@@ -207,6 +207,16 @@ def __init__(self, values=None):
207
# We only need this to support .reset()
208
self.default_value = self.values.copy()
209
210
+ @classmethod
211
+ def create(klass, values=None):
212
+ ''' Factory method to create sparse datastore.
213
+ Use setValues to initialize registers.
214
+
215
+ :param values: Either a list or a dictionary of values
216
+ :returns: An initialized datastore
217
+ '''
218
+ return klass(values)
219
220
def reset(self):
221
''' Reset the store to the intially provided defaults'''
222
self.values = self.default_value.copy()
0 commit comments