button click script:
def runAction(self, event):
element = self.getSibling("Drawing1").props.elements[0]
oldColor = element.fill.paint
system.tag.writeBlocking(["[default]DrawingTag/OldFill"], [oldColor])
if oldColor == "yellow":
newColor = "green"
else:
newColor = "yellow"
element.fill.paint = newColor
system.tag.writeBlocking(["[default]DrawingTag/NewFill"], [newColor])
message handler scripts:
def onMessageReceived(self, payload):
element = self.getChild("Drawing1").props.elements[0]
oldColor = element.fill.paint
system.tag.writeBlocking(["[default]DrawingTag/OldFill"], [oldColor])
if oldColor == "yellow":
newColor = "green"
else:
newColor = "yellow"
element.fill.paint = newColor
system.tag.writeBlocking(["[default]DrawingTag/NewFill"], [newColor])
Add: when the message was received, the color of the graphics in the designer changed, but the web interface remained unchanged.
