karlentwistle/ruby_home

View on GitHub
bin/ruby_home

Summary

Maintainability
Test Coverage
#!/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