I have a simple web thing written in python with an ‘on’ property -
def make_thing():
thing = Thing('My Lamp', ['OnOffSwitch', 'Light'], 'A web connected lamp')
thing.add_property(
Property(thing,
'on',
Value(True),
metadata={
'@type': 'OnOffProperty',
'title': 'On/Off',
'type': 'boolean',
'description': 'Whether the lamp is turned on',
}))
Is it possible to attach an event to this on property so another piece of code can be run when the user changes the sate of My Lamp?