From 1bf5e0a7d4104ddc214e90a7466d50b2a4f034c8 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Wed, 11 Mar 2015 22:43:08 +0100 Subject: [PATCH] Add support for the `at' condition This is just the same as having a `from' and `until' condition (the latter with t + 1 minute). --- lib/hued/rule.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/hued/rule.rb b/lib/hued/rule.rb index cf5b565..9ba75ce 100644 --- a/lib/hued/rule.rb +++ b/lib/hued/rule.rb @@ -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"