Indigo + RubyOSA
August 17th, 2007
Decided to quickly at lunch show rubyOSA and Indigo in action…
First open up IRB and require rubygems and rubyosa.
irb(main):001:0> require "rubygems"
=> true
irb(main):002:0> require "rbosa"
=> true
Then bind OSA to Indigo server (Indigo must be started)
irb(main):003:0> home = OSA.app('IndigoServer')
=> <OSA::IndigoServer::Application:0x24fc2f0 desc="'sign'($4F444E49$)">
As you can see here are a bunch of lights that in various states:

I want to turn all the lights in the house on. So I grab my new ‘home’ object and manipulate.
irb(main):004:0> home.all_lights_on
=> nil
As you can see now all the lights are on:

I decide it’s time to turn them all off so I grab that same ‘home’ object and shut them off.
irb(main):006:0> home.daylight? ? home.all_lights_off : home.all_lights_on
=> nil
Tada… All the lights are now off:

There is much much more to come.




0 comments have been made on 'Indigo + RubyOSA'