Class: SetWifiAction

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

Overview

Category: Connectivity

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ SetWifiAction

Returns a new instance of SetWifiAction.



2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
# File 'lib/ruby-macrodroid.rb', line 2415

def initialize(h={})

  options = {
    ssid: '[Select Wifi]',
    network_id: 0,
    state: 0
  }

  super(options.merge h)

end

Instance Method Details

#to_s ⇒ Object



2427
2428
2429
2430
# File 'lib/ruby-macrodroid.rb', line 2427

def to_s()
  action = @h[:state] == 0 ? 'Enable' : 'Disable'
  action + ' Wifi'
end