class CameraFlashLightAction

Category: Device Settings

Public Class Methods

new(h={}) click to toggle source

options

0  Toch On
1  Torch Off
2  Torch Toggle
Calls superclass method DeviceSettingsAction::new
# File lib/ruby-macrodroid/actions.rb, line 1355
def initialize(h={})

  options = {
    launch_foreground: false,
    state: 0
  }

  super(options.merge h)

end

Public Instance Methods

invoke() click to toggle source
Calls superclass method Action#invoke
# File lib/ruby-macrodroid/actions.rb, line 1365
def invoke()
  super(state: @h[:state])
end
to_pc() click to toggle source
# File lib/ruby-macrodroid/actions.rb, line 1369
def to_pc()
  ['torch :on', 'torch :off', 'torch :toggle'][@h[:state]]
end
to_s(colour: false, indent: 0) click to toggle source
# File lib/ruby-macrodroid/actions.rb, line 1373
def to_s(colour: false, indent: 0)
  ['Torch On', 'Torch Off', 'Torch Toggle'][@h[:state]]    
end