Class: Switchbot::ColorBulb

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/switchbot/color_bulb.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, device_id:) ⇒ ColorBulb

Returns a new instance of ColorBulb.



9
10
11
# File 'lib/switchbot/color_bulb.rb', line 9

def initialize(client:, device_id:)
  @device = Device.new(client: client, device_id: device_id)
end

Instance Method Details

#brightness(value) ⇒ Object



17
18
19
# File 'lib/switchbot/color_bulb.rb', line 17

def brightness(value)
  commands(command: 'setBrightness', parameter: value)
end

#color(value) ⇒ Object



21
22
23
# File 'lib/switchbot/color_bulb.rb', line 21

def color(value)
  commands(command: 'setColor', parameter: value)
end

#color_temperature(value) ⇒ Object



25
26
27
# File 'lib/switchbot/color_bulb.rb', line 25

def color_temperature(value)
  commands(command: 'setColorTemperature', parameter: value)
end

#toggleObject



13
14
15
# File 'lib/switchbot/color_bulb.rb', line 13

def toggle
  commands(command: 'toggle')
end