Add support for the `at' condition

This is just the same as having a `from' and `until' condition (the latter
with t + 1 minute).
This commit is contained in:
Paul van Tilburg 2015-03-11 22:43:08 +01:00
parent 9783142eb0
commit 1bf5e0a7d4
1 changed files with 3 additions and 0 deletions

View File

@ -117,6 +117,9 @@ module Hued
Time.now >= Chronic.parse(cond_value)
when "until"
Time.now <= Chronic.parse(cond_value)
when "at"
time = Chronic.parse(cond_value)
time <= Time.now and Time.now < time + 60
when "found host"
system("ping -W3 -c1 -q #{cond_value} > /dev/null 2>&1")
when "weekday", "weekdays"