Module: MiOS::Services::DoorLock1

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

Constant Summary collapse

URN =
'urn:micasaverde-com:serviceId:DoorLock1'

Instance Method Summary collapse

Instance Method Details

#clear_pin(index, async = false, &block) ⇒ Object



40
41
42
# File 'lib/mios/services/door_lock1.rb', line 40

def clear_pin(index, async=false, &block)
  set(URN, 'ClearPin', { "UserCode" => index }, async, &block)
end

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



28
29
30
# File 'lib/mios/services/door_lock1.rb', line 28

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

#locked?Boolean



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

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

#max_pin_sizeObject



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

def max_pin_size
  value_for URN, 'MaxPinSize', as: Integer
end

#min_pin_sizeObject



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

def min_pin_size
  value_for URN, 'MinPinSize', as: Integer
end

#pincodesObject



23
24
25
26
# File 'lib/mios/services/door_lock1.rb', line 23

def pincodes
  tmp = value_for(URN, 'PinCodes')
  tmp.gsub!(/^<[^>]+>/, '').split("\t")
end

#set_pin(name, pin, index, async = false, &block) ⇒ Object



36
37
38
# File 'lib/mios/services/door_lock1.rb', line 36

def set_pin(name, pin, index, async=false, &block)
  set(URN, 'SetPin', { "UserCodeName" => name, "newPin" => pin, "user" => index }, async, &block)
end

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



32
33
34
# File 'lib/mios/services/door_lock1.rb', line 32

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

#unlocked?Boolean



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

def unlocked?
  !locked?
end