Class: Switchbot::Lock

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/switchbot/lock.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, device_id:) ⇒ Lock

Returns a new instance of Lock.



9
10
11
# File 'lib/switchbot/lock.rb', line 9

def initialize(client:, device_id:)
  @device = Device.new(client: client, device_id: device_id)
end

Instance Method Details

#lockObject



13
14
15
# File 'lib/switchbot/lock.rb', line 13

def lock
  commands(command: 'lock')
end

#unlockObject



17
18
19
# File 'lib/switchbot/lock.rb', line 17

def unlock
  commands(command: 'unlock')
end