class Geppeto::Commands::Power

Public Class Methods

new(scout) click to toggle source
# File lib/commands/power.rb, line 4
def initialize(scout)
  @scout = scout
end

Public Instance Methods

battery?() click to toggle source
# File lib/commands/power.rb, line 12
def battery?
  @scout.request("power.hasbattery").to_i == 1
end
charging?() click to toggle source
# File lib/commands/power.rb, line 8
def charging?
  @scout.request("power.ischarging").to_i == 1
end
disablevcc() click to toggle source
# File lib/commands/power.rb, line 28
def disablevcc
  @scout.request("power.disablevcc")
end
enablevcc() click to toggle source
# File lib/commands/power.rb, line 24
def enablevcc
  @scout.request("power.enablevcc")
end
percent() click to toggle source
# File lib/commands/power.rb, line 16
def percent
  @scout.request("power.percent").to_i
end
report() click to toggle source
# File lib/commands/power.rb, line 40
def report
  @scout.request("power.report")
end
sleep(ms, command = nil) click to toggle source
# File lib/commands/power.rb, line 36
def sleep(ms, command = nil)
  @scout.request("power.sleep", ms, command)
end
vcc?() click to toggle source
# File lib/commands/power.rb, line 32
def vcc?
  @scout.request("power.isvccenabled").to_i == 1
end
voltage() click to toggle source
# File lib/commands/power.rb, line 20
def voltage
  @scout.request("power.voltage").to_i
end