Skip to content

Instantly share code, notes, and snippets.

@johnbeynon
Created January 7, 2014 20:41
Show Gist options
  • Save johnbeynon/8306497 to your computer and use it in GitHub Desktop.
Save johnbeynon/8306497 to your computer and use it in GitHub Desktop.
first pass at duplicating Philips Wake up light functionality
# 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