Module: MiOS::Services::SwitchPower1
- Defined in:
- lib/mios/services/switch_power1.rb
Class Method Summary collapse
Instance Method Summary collapse
- #off!(async = false, &block) ⇒ Object
- #off? ⇒ Boolean
- #on!(async = false, &block) ⇒ Object
- #on? ⇒ Boolean
Class Method Details
.extended(base) ⇒ Object
4 5 6 |
# File 'lib/mios/services/switch_power1.rb', line 4 def self.extended(base) base.instance_variable_set("@switchpower1_urn", "urn:upnp-org:serviceId:SwitchPower1") end |
Instance Method Details
#off!(async = false, &block) ⇒ Object
20 21 22 |
# File 'lib/mios/services/switch_power1.rb', line 20 def off!(async=false, &block) set(@switchpower1_urn, "SetTarget", {"newTargetValue" => 0}, async, &block) end |
#off? ⇒ Boolean
12 13 14 |
# File 'lib/mios/services/switch_power1.rb', line 12 def off? !on? end |
#on!(async = false, &block) ⇒ Object
16 17 18 |
# File 'lib/mios/services/switch_power1.rb', line 16 def on!(async=false, &block) set(@switchpower1_urn, "SetTarget", {"newTargetValue" => 1}, async, &block) end |
#on? ⇒ Boolean
8 9 10 |
# File 'lib/mios/services/switch_power1.rb', line 8 def on? boolean_for(@switchpower1_urn, 'Status') end |