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:
parent
9783142eb0
commit
1bf5e0a7d4
|
@ -117,6 +117,9 @@ module Hued
|
||||||
Time.now >= Chronic.parse(cond_value)
|
Time.now >= Chronic.parse(cond_value)
|
||||||
when "until"
|
when "until"
|
||||||
Time.now <= Chronic.parse(cond_value)
|
Time.now <= Chronic.parse(cond_value)
|
||||||
|
when "at"
|
||||||
|
time = Chronic.parse(cond_value)
|
||||||
|
time <= Time.now and Time.now < time + 60
|
||||||
when "found host"
|
when "found host"
|
||||||
system("ping -W3 -c1 -q #{cond_value} > /dev/null 2>&1")
|
system("ping -W3 -c1 -q #{cond_value} > /dev/null 2>&1")
|
||||||
when "weekday", "weekdays"
|
when "weekday", "weekdays"
|
||||||
|
|
Reference in New Issue