Class: Switchbot::Humidifier

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

Instance Method Summary collapse

Constructor Details

#initialize(client:, device_id:) ⇒ Humidifier

Returns a new instance of Humidifier.



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

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

Instance Method Details

#autoObject



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

def auto
  mode(:auto)
end

#highObject



29
30
31
# File 'lib/switchbot/humidifier.rb', line 29

def high
  mode(103)
end

#lowObject



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

def low
  mode(101)
end

#mediumObject



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

def medium
  mode(102)
end

#mode(value) ⇒ Object



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

def mode(value)
  commands(command: 'setMode', parameter: value.to_s)
end