class MideaAirCondition::Command::Set

Request status of a device

Public Instance Methods

fan_speed(speed) click to toggle source
# File lib/commands/set.rb, line 20
def fan_speed(speed)
  @data[0x0d] = speed
end
temperature(celsius, mode: 2) click to toggle source
# File lib/commands/set.rb, line 15
def temperature(celsius, mode: 2)
  c = ((mode << 5) & 0xe0) | (celsius & 0xf) | ((celsius << 4) & 0x10)
  @data[0x0c] = c
end
turn_off() click to toggle source
# File lib/commands/set.rb, line 11
def turn_off
  @data[0x0b] = 0x42
end
turn_on() click to toggle source
# File lib/commands/set.rb, line 7
def turn_on
  @data[0x0b] = 0x43
end

Private Instance Methods

fill() click to toggle source
# File lib/commands/set.rb, line 26
def fill
  @data[0x0a] = 0x40

  temperature 22
  fan_speed 40
end