Class: SetWifiAction

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

Overview

Category: Connectivity

Instance Attribute Summary

Attributes inherited from Action

#constraints

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.



2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
# File 'lib/ruby-macrodroid.rb', line 2644

def initialize(h={})

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

  super(options.merge h)

end

Instance Method Details

#to_sObject



2656
2657
2658
2659
# File 'lib/ruby-macrodroid.rb', line 2656

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