Class: WifiConnectionTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- WifiConnectionTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: Connectivity
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(obj = nil) ⇒ WifiConnectionTrigger
constructor
A new instance of WifiConnectionTrigger.
- #to_s(colour: false) ⇒ Object
- #to_summary ⇒ Object
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(obj = nil) ⇒ WifiConnectionTrigger
Returns a new instance of WifiConnectionTrigger.
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'lib/ruby-macrodroid/triggers.rb', line 473 def initialize(obj=nil) h = if obj.is_a? Hash then obj elsif obj.is_a? Array e, macro = obj {ssid_list: [e.text('item/description').to_s], wifi_state: 2} end = { ssid_list: [], wifi_state: 0 } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object
491 492 493 494 495 496 |
# File 'lib/ruby-macrodroid/triggers.rb', line 491 def to_s(colour: false) access_point = @h[:ssid_list].first @s = 'Connected to network' @s += "\n" + access_point super() end |
#to_summary ⇒ Object
498 499 500 501 |
# File 'lib/ruby-macrodroid/triggers.rb', line 498 def to_summary() access_point = @h[:ssid_list].first 'Connected to network' + access_point end |