Class: TPLink::Plug
Overview
Control TPLink Smart Plugs
Instance Attribute Summary
Attributes inherited from Device
Instance Method Summary collapse
-
#off ⇒ Object
Turn device off.
-
#on ⇒ Object
Turn device on.
-
#toggle ⇒ Object
Toggle device (turn off if on, on if off).
Methods inherited from Device
Instance Method Details
#off ⇒ Object
Turn device off
12 13 14 |
# File 'lib/tp_link/plug.rb', line 12 def off relay_state(0) end |
#on ⇒ Object
Turn device on
7 8 9 |
# File 'lib/tp_link/plug.rb', line 7 def on relay_state(1) end |
#toggle ⇒ Object
Toggle device (turn off if on, on if off)
17 18 19 20 21 22 23 |
# File 'lib/tp_link/plug.rb', line 17 def toggle if on? off else on end end |