class LightLevelConstraint

Category: Sensors

Public Class Methods

new(h={}) click to toggle source
Calls superclass method Constraint::new
# File lib/ruby-macrodroid/constraints.rb, line 1308
def initialize(h={})

  options = {
    light_level: -1,
    light_level_float: 5000.0,
    option: 1
  }

  super(options.merge h)

end

Public Instance Methods

to_s(colour: false, indent: 0) click to toggle source
# File lib/ruby-macrodroid/constraints.rb, line 1320
def to_s(colour: false, indent: 0)
  
  operator = @h[:light_level] == -1 ? 'Less than' : 'Greater than'    
  condition = operator + ' ' + @h[:light_level_float].to_s + 'lx'
  'Light Sensor ' + condition
  
end