Class: SetHotspotAction

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

Instance Attribute Summary

Attributes inherited from Action

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ SetHotspotAction

Returns a new instance of SetHotspotAction.



552
553
554
555
556
557
558
559
560
561
# File 'lib/ruby-macrodroid/actions.rb', line 552

def initialize(h={})

  options = {
    device_name: "", state: 0, turn_wifi_on: true, use_legacy_mechanism: false, mechanism: 0

  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object



563
564
565
566
# File 'lib/ruby-macrodroid/actions.rb', line 563

def to_s(colour: false)
  action = @h[:turn_wifi_on] ? 'Enable' : 'Disable'
  action + ' HotSpot'
end