Class: WifiSSIDTrigger

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

Overview

Category: Connectivity

Also known as Wifi SSID Transition

options:

in_range: true | false
wifi_cell_info: {display_name: "some Wifi SSID", 
                 ssid: "some Wifi SSID"} - 1 or more allowed

Instance Attribute Summary

Attributes inherited from Trigger

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Trigger

#match?

Constructor Details

#initialize(h = {}) ⇒ WifiSSIDTrigger

Returns a new instance of WifiSSIDTrigger.



602
603
604
605
606
607
608
609
610
611
612
# File 'lib/ruby-macrodroid/triggers.rb', line 602

def initialize(h={})

  options = {
    wifi_cell_info_list: [{:display_name=>"", :ssid=>""}],
    ssid_list: [],
    in_range: true
  }

  super(options.merge h)

end

Instance Method Details

#to_hObject



614
615
616
617
618
619
620
621
622
623
624
# File 'lib/ruby-macrodroid/triggers.rb', line 614

def to_h()
  
  h = super()
  val = h[:m_inRange]
  
  h[:m_InRange] = val
  h.delete :m_inRange
  
  return h
  
end

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



626
627
628
# File 'lib/ruby-macrodroid/triggers.rb', line 626

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