Class: ScreenOnAction

Inherits:
ScreenAction show all
Defined in:
lib/ruby-macrodroid/actions.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 included from ObjectX

#action_to_object, #object_create, #varify

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ ScreenOnAction

Returns a new instance of ScreenOnAction.



2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
# File 'lib/ruby-macrodroid/actions.rb', line 2359

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, indent: 0) ⇒ Object Also known as: to_summary



2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
# File 'lib/ruby-macrodroid/actions.rb', line 2372

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