This is a variable and/or python question. How do I get the last changed time of a variable? Here is a simple example of what I'm trying to do for a few different scenarios, so once I figure this one I should be good for other use cases. This works for a device obviously but what is the variable equivalent for below?
- Code: Select all
motion = indigo.devices[1987458174]
timeDelta = datetime.now() - motion.lastChanged
if light.onState and timeDelta.seconds > 60:
indigo.device.turnOff(1606772561)