-
Notifications
You must be signed in to change notification settings - Fork 531
Expand file tree
/
Copy pathinit.lua
More file actions
26 lines (20 loc) · 730 Bytes
/
init.lua
File metadata and controls
26 lines (20 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0
local command_mt = {}
command_mt.__command_cache = {}
command_mt.__index = function(self, key)
if command_mt.__command_cache[key] == nil then
local req_loc = string.format("DoorLock.client.commands.%s", key)
local raw_def = require(req_loc)
local cluster = rawget(self, "_cluster")
command_mt.__command_cache[key] = raw_def:set_parent_cluster(cluster)
end
return command_mt.__command_cache[key]
end
local DoorLockClientCommands = {}
function DoorLockClientCommands:set_parent_cluster(cluster)
self._cluster = cluster
return self
end
setmetatable(DoorLockClientCommands, command_mt)
return DoorLockClientCommands