Class: SetHotspotAction
- Inherits:
-
ConnectivityAction
- Object
- MacroObject
- Action
- ConnectivityAction
- SetHotspotAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ SetHotspotAction
constructor
A new instance of SetHotspotAction.
- #to_s(colour: false, indent: 0) ⇒ Object
Methods inherited from Action
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ SetHotspotAction
875 876 877 878 879 880 881 882 883 884 885 886 887 |
# File 'lib/ruby-macrodroid/actions.rb', line 875 def initialize(h={}) # to-do: check when *disable hotspot*, is the # *enable wifi* option selected? = { device_name: "", state: 0, turn_wifi_on: true, use_legacy_mechanism: false, mechanism: 0 } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
889 890 891 892 893 894 895 896 897 898 899 |
# File 'lib/ruby-macrodroid/actions.rb', line 889 def to_s(colour: false, indent: 0) @s = "%s HotSpot" % [@h[:state] == 0 ? 'Enable' : 'Disable'] if @h[:state] == 1 then @s += "\n" + (@h[:turn_wifi_on] ? 'Enable WiFi' : 'Don\'t Enable Wifi') end super() end |