Class: CameraFlashLightAction

Inherits:
DeviceSettingsAction show all
Defined in:
lib/ruby-macrodroid.rb

Overview

Category: Device Settings

Instance Attribute Summary

Attributes inherited from Action

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ CameraFlashLightAction

Returns a new instance of CameraFlashLightAction.



3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
# File 'lib/ruby-macrodroid.rb', line 3508

def initialize(h={})

  options = {
    launch_foreground: false,
    state: 0
  }

  super(options.merge h)

end

Instance Method Details

#to_pcObject



3519
3520
3521
# File 'lib/ruby-macrodroid.rb', line 3519

def to_pc()
  ['torch :on', 'torch :off', 'torch :toggle'][@h[:state]]
end

#to_s(colour: false) ⇒ Object



3523
3524
3525
# File 'lib/ruby-macrodroid.rb', line 3523

def to_s(colour: false)
  ['Torch On', 'Torch Off', 'Torch Toggle'][@h[:state]]    
end