Created
January 7, 2014 20:41
-
-
Save johnbeynon/8306497 to your computer and use it in GitHub Desktop.
first pass at duplicating Philips Wake up light functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fade up Light from 0 to 80% over 30 minutes | |
time_to_take = 1800 # in seconds | |
increase_to_level = 80 # percent | |
number_of_steps = increase_to_level / 10 | |
time_per_step = time_to_take / number_of_steps | |
0.upto(number_of_steps) do |loop_index| | |
level = loop_index * 10 | |
puts "Increasing Light Level to #{level}%" | |
command = "lightwaverf Bedroom 'light' #{level}%" | |
`#{command}` | |
sleep time_per_step | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment