@slagle, @jody.albritton when trying to store an object in the state variable, it ends up being cleared after the function exits.
e…g
def modeChangeHandler(evt) {
state.queuedActions = [[event:evt, time:(now() + (1 * 60 * 1000) as Long)]]
log.trace "Queued actions: $state.queuedActions" // DEBUG
}
modeChangeHandler
is a subscription to mode. When called it the live log correctly shows (note it stores the event object):
Queued actions: [[event:physicalgraph.app.EventWrapper@12a537be, time:1469894923933]]
There is a another scheduled function heartBeat
which is called every 5 minutes:
def heartBeat() {
log.trace "Heartbeat called, pending actions: $state.queuedActions"
}
When heartBeat is called it shows:
Heartbeat called, pending actions:
If I use:
state.queuedActions = [[time:(now() + (1 * 60 * 1000) as Long)]]
instead of:
state.queuedActions = [[event:evt, time:(now() + (1 * 60 * 1000) as Long)]]
it works fine in both functions.
Is this by design for state to not store objects or is there an issue I should report?