bin/ruby_home
#!/usr/bin/env ruby
require_relative '../lib/ruby_home'
accessory_information = RubyHome::ServiceFactory.create(:accessory_information)
fan = RubyHome::ServiceFactory.create(:fan)
fan.on.after_update do |updated_value|
if updated_value
puts "Fan switched on"
else
puts "Fan switched off"
end
end
RubyHome.run