Class: MiOS::Scene
- Inherits:
-
Object
- Object
- MiOS::Scene
- Defined in:
- lib/mios/scene.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(interface, id, name) ⇒ Scene
constructor
A new instance of Scene.
- #run ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(interface, id, name) ⇒ Scene
Returns a new instance of Scene.
5 6 7 8 9 |
# File 'lib/mios/scene.rb', line 5 def initialize(interface, id, name) @interface = interface @id = id.to_i @name = name end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/mios/scene.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/mios/scene.rb', line 3 def name @name end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 |
# File 'lib/mios/scene.rb', line 15 def run response = Action.new(@interface, 'urn:micasaverde-com:serviceId:HomeAutomationGateway1', 'RunScene', 'SceneNum' => @id).take response.values.first.values.first end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/mios/scene.rb', line 11 def to_s name end |