diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-12-24 17:05:46 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-12-24 17:05:46 +0000 |
commit | dfddc1e6bf9a4b91af550c3039611e939a6a1e55 (patch) | |
tree | 4baf29b35cb50f39472de185aef9c818c8166c73 | |
parent | Process events in order without cache (diff) | |
download | toy-dfddc1e6bf9a4b91af550c3039611e939a6a1e55.zip |
Functions for getting/setting away status
-rw-r--r-- | scripts/toy.groovy | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy index f5182aa..8f3a10a 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -160,6 +160,8 @@ def set = {i, s -> save("toy.state.$i", s)}; def positioned = { i -> loadString("toy.position") == i }; def getPunish = { loadInteger("toy.punishment") ?: 0; }; def adjustPunish = { p -> save("toy.punishment", Math.max(getPunish() + (int)p, 0)); }; +def getAway = { loadString("toy.owner.away") }; +def setAway = { a -> save("toy.owner.away", a) }; def namedEvents; def loadEvents = { return (loadMap("toy.events") ?: [:]); |