Class: ScreenOnAction

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

Overview

Category: Screen

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 = {}) ⇒ ScreenOnAction

Returns a new instance of ScreenOnAction.



4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
# File 'lib/ruby-macrodroid.rb', line 4501

def initialize(h={})

  options = {
    pie_lock_screen: false,
    screen_off: true,
    screen_off_no_lock: false,
    screen_on_alternative: false
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object Also known as: to_summary



4514
4515
4516
4517
4518
4519
4520
4521
4522
# File 'lib/ruby-macrodroid.rb', line 4514

def to_s(colour: false)
  
  state = @h[:screen_off] ? 'Off' : 'On'
  state += ' ' + 'No Lock (root only)' if @h[:screen_off_no_lock]
  #state += ' ' + '(Alternative)' if @h[:screen_on_alternative]
  
  'Screen ' + state
  
end