Class: Huebot::Light

Inherits:
Object
  • Object
show all
Includes:
DeviceState
Defined in:
lib/huebot/light.rb

Defined Under Namespace

Classes: Input

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DeviceState

#get_state, #set_state

Constructor Details

#initialize(client, id, attrs) ⇒ Light

Returns a new instance of Light.



13
14
15
16
17
18
# File 'lib/huebot/light.rb', line 13

def initialize(client, id, attrs)
  @client = client
  @id = id.to_i
  @name = attrs.fetch("name")
  @attrs = attrs
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



11
12
13
# File 'lib/huebot/light.rb', line 11

def client
  @client
end

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/huebot/light.rb', line 11

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/huebot/light.rb', line 11

def name
  @name
end