Class: MiOS::Scene

Inherits:
Object
  • Object
show all
Defined in:
lib/mios/scene.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/mios/scene.rb', line 3

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/mios/scene.rb', line 3

def name
  @name
end

Instance Method Details

#runObject



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_sObject



11
12
13
# File 'lib/mios/scene.rb', line 11

def to_s
  name
end