Add the weekdays condition

This commit is contained in:
Paul van Tilburg 2014-11-22 12:11:08 +01:00
parent 51257cefd1
commit b676d6d3e6
1 changed files with 3 additions and 0 deletions

View File

@ -114,6 +114,9 @@ module Hued
Time.now <= Chronic.parse(cond_value)
when "found host"
system("ping -W3 -c1 -q #{cond_value} > /dev/null 2>&1")
when "weekday", "weekdays"
weekdays = cond_value.split(/,\s*/).map(&:downcase)
weekdays.include? Time.now.strftime("%a").downcase
end
else
@log.warn "Unknown condition type/form #{cond.inspect}"