Class: WeatherTrigger

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

Overview

Category: Location

Instance Attribute Summary

Attributes inherited from Trigger

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Trigger

#match?

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ WeatherTrigger

Returns a new instance of WeatherTrigger.



1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
# File 'lib/ruby-macrodroid/triggers.rb', line 1264

def initialize(h={})

  options = {
    humidity_above: true,
    humidity_value: 50,
    option: 4,
    temp_below: true,
    temp_celcius: true,
    temperature: 0,
    weather_condition: 0,
    wind_speed_above: true,
    wind_speed_value: 0,
    wind_speed_value_mph: 0
  }

  super(options.merge h)

end

Instance Method Details

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



1283
1284
1285
# File 'lib/ruby-macrodroid/triggers.rb', line 1283

def to_s(colour: false)
  'WeatherTrigger ' + @h.inspect
end