Module: MiOS::Services::SwitchPower1

Defined in:
lib/mios/services/switch_power1.rb

Constant Summary collapse

URN =
'urn:upnp-org:serviceId:SwitchPower1'

Instance Method Summary collapse

Instance Method Details

#off!(async = false, &block) ⇒ Object



19
20
21
# File 'lib/mios/services/switch_power1.rb', line 19

def off!(async=false, &block)
  set(URN, 'SetTarget', { "newTargetValue" => 0 }, async, &block)
end

#off?Boolean

Returns:



11
12
13
# File 'lib/mios/services/switch_power1.rb', line 11

def off?
  !on?
end

#on!(async = false, &block) ⇒ Object



15
16
17
# File 'lib/mios/services/switch_power1.rb', line 15

def on!(async=false, &block)
  set(URN, 'SetTarget', { "newTargetValue" => 1 }, async, &block)
end

#on?Boolean

Returns:



7
8
9
# File 'lib/mios/services/switch_power1.rb', line 7

def on?
  value_for URN, 'Status', as: Boolean
end