readme and fix in structured mode

This commit is contained in:
Wolfgang Hottgenroth
2022-02-22 17:15:33 +01:00
parent d44460bed5
commit 35087f89ca
4 changed files with 88 additions and 7 deletions

View File

@ -6,10 +6,10 @@ from AbstractDataObject import AbstractDataObject
class StructuredDataObject(AbstractDataObject):
def __init__(self, topicPart):
super().__init__(topicPart)
self.keyValuePairs = []
self.keyValuePairs = {}
def add(self, key, value):
self.keyValuePairs.append({key: value})
self.keyValuePairs[key] = value
def getPayload(self):
return json.dumps(self.keyValuePairs)