I've been using the EventHook example in several other Python projects, which is very effective for this kind of thing. I'm sure there are other ways to handle this in Indigo, just throwing it out as an example of what I'm looking for.
So a simple use could be:
- Code: Select all
# plugin.py
def deviceStartComm(self, device):
device.onStateChange += self.deviceStateChanged
def deviceStateChanged(device, stateName):
self.logger.debug('State Change: %s[%s] => %s', device.name, stateName, device.states[stateName])
Any thoughts on such a thing?