Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local function can_handle_aeotec_nano_shutter(opts, driver, device, ...)
local FINGERPRINTS = require("aeotec-nano-shutter.fingerprints")
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:id_match(fingerprint.mfr, fingerprint.prod, fingerprint.model) then
return true, require("aeotec-nano-shutter")
end
end
return false
end

return can_handle_aeotec_nano_shutter
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local AEOTEC_NANO_SHUTTER_FINGERPRINTS = {
{mfr = 0x0086, prod = 0x0003, model = 0x008D}, -- Aeotec nano shutter EU
{mfr = 0x0086, prod = 0x0103, model = 0x008D}, -- Aeotec nano shutter US
{mfr = 0x0371, prod = 0x0003, model = 0x008D}, -- Aeotec nano shutter EU
{mfr = 0x0371, prod = 0x0103, model = 0x008D} -- Aeotec nano shutter US
}

return AEOTEC_NANO_SHUTTER_FINGERPRINTS
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local capabilities = require "st.capabilities"
--- @type st.zwave.CommandClass
Expand All @@ -28,26 +18,12 @@ local SET_BUTTON_TO_CLOSE = "close"
local SET_BUTTON_TO_PAUSE = "pause"
local SHADE_STATE = "shade_state"

local AEOTEC_NANO_SHUTTER_FINGERPRINTS = {
{mfr = 0x0086, prod = 0x0003, model = 0x008D}, -- Aeotec nano shutter EU
{mfr = 0x0086, prod = 0x0103, model = 0x008D}, -- Aeotec nano shutter US
{mfr = 0x0371, prod = 0x0003, model = 0x008D}, -- Aeotec nano shutter EU
{mfr = 0x0371, prod = 0x0103, model = 0x008D} -- Aeotec nano shutter US
}

--- Determine whether the passed device is proper
---
--- @param driver st.zwave.Driver
--- @param device st.zwave.Device
--- @return boolean true if the device is proper, else false
local function can_handle_aeotec_nano_shutter(opts, driver, device, ...)
for _, fingerprint in ipairs(AEOTEC_NANO_SHUTTER_FINGERPRINTS) do
if device:id_match(fingerprint.mfr, fingerprint.prod, fingerprint.model) then
return true
end
end
return false
end

--- Default handler for basic reports for the devices
---
Expand Down Expand Up @@ -140,7 +116,7 @@ local aeotec_nano_shutter = {
added = added_handler
},
NAME = "Aeotec nano shutter",
can_handle = can_handle_aeotec_nano_shutter
can_handle = require("aeotec-nano-shutter.can_handle"),
}

return aeotec_nano_shutter
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local function can_handle_iblinds_window_treatment(opts, driver, device, ...)
local FINGERPRINTS = require("iblinds-window-treatment.fingerprints")
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:id_match(fingerprint.mfr, fingerprint.prod, fingerprint.model) then
return true, require("iblinds-window-treatment")
end
end
return false
end

return can_handle_iblinds_window_treatment
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local IBLINDS_WINDOW_TREATMENT_FINGERPRINTS = {
{mfr = 0x0287, prod = 0x0003, model = 0x000D}, -- iBlinds Window Treatment v1 / v2
{mfr = 0x0287, prod = 0x0004, model = 0x0071}, -- iBlinds Window Treatment v3
{mfr = 0x0287, prod = 0x0004, model = 0x0072} -- iBlinds Window Treatment v3.1
}

return IBLINDS_WINDOW_TREATMENT_FINGERPRINTS
Original file line number Diff line number Diff line change
@@ -1,41 +1,18 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local capabilities = require "st.capabilities"
--- @type st.zwave.CommandClass.SwitchMultilevel
local SwitchMultilevel = (require "st.zwave.CommandClass.SwitchMultilevel")({ version=3 })
local window_preset_defaults = require "window_preset_defaults"

local IBLINDS_WINDOW_TREATMENT_FINGERPRINTS = {
{mfr = 0x0287, prod = 0x0003, model = 0x000D}, -- iBlinds Window Treatment v1 / v2
{mfr = 0x0287, prod = 0x0004, model = 0x0071}, -- iBlinds Window Treatment v3
{mfr = 0x0287, prod = 0x0004, model = 0x0072} -- iBlinds Window Treatment v3.1
}

--- Determine whether the passed device is iblinds window treatment
---
--- @param driver st.zwave.Driver
--- @param device st.zwave.Device
--- @return boolean true if the device is iblinds window treatment, else false
local function can_handle_iblinds_window_treatment(opts, driver, device, ...)
for _, fingerprint in ipairs(IBLINDS_WINDOW_TREATMENT_FINGERPRINTS) do
if device:id_match(fingerprint.mfr, fingerprint.prod, fingerprint.model) then
return true
end
end
return false
end

local capability_handlers = {}

Expand Down Expand Up @@ -91,11 +68,9 @@ local iblinds_window_treatment = {
[capabilities.windowShadePreset.commands.presetPosition.NAME] = capability_handlers.preset_position
}
},
sub_drivers = {
require("iblinds-window-treatment.v3")
},
sub_drivers = require("iblinds-window-treatment.sub_drivers"),
NAME = "iBlinds window treatment",
can_handle = can_handle_iblinds_window_treatment
can_handle = require("iblinds-window-treatment.can_handle"),
}

return iblinds_window_treatment
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local lazy_load_if_possible = require("lazy_load_subdriver")

return {
lazy_load_if_possible("iblinds-window-treatment.v3")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

--- Determine whether the passed device is iblinds window treatment v3
---
--- @param driver st.zwave.Driver
--- @param device st.zwave.Device
--- @return boolean true if the device is iblinds window treatment, else false
local function can_handle_iblinds_window_treatment_v3(opts, driver, device, ...)
local FINGERPRINTS = require("iblinds-window-treatment.v3.fingerprints")
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:id_match(fingerprint.mfr, fingerprint.prod, fingerprint.model) then
return true, require("iblinds-window-treatment.v3")
end
end
return false
end

return can_handle_iblinds_window_treatment_v3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local IBLINDS_WINDOW_TREATMENT_FINGERPRINTS_V3 = {
{mfr = 0x0287, prod = 0x0004, model = 0x0071}, -- iBlinds Window Treatment v3
{mfr = 0x0287, prod = 0x0004, model = 0x0072} -- iBlinds Window Treatment v3
}

return IBLINDS_WINDOW_TREATMENT_FINGERPRINTS_V3
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local capabilities = require "st.capabilities"
--- @type st.zwave.CommandClass.SwitchMultilevel
Expand Down
23 changes: 4 additions & 19 deletions drivers/SmartThings/zwave-window-treatment/src/init.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local capabilities = require "st.capabilities"
--- @type st.zwave.defaults
Expand Down Expand Up @@ -84,12 +74,7 @@ local driver_template = {
[capabilities.windowShadePreset.commands.presetPosition.NAME] = window_preset_defaults.window_shade_preset_cmd,
}
},
sub_drivers = {
require("springs-window-fashion-shade"),
require("iblinds-window-treatment"),
require("window-treatment-venetian"),
require("aeotec-nano-shutter")
}
sub_drivers = require("sub_drivers"),
}

defaults.register_for_default_handlers(driver_template, driver_template.supported_capabilities)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


return function(sub_driver_name)
-- gets the current lua libs api version
local ZwaveDriver = require "st.zwave.driver"
local version = require "version"

if version.api >= 16 then
return ZwaveDriver.lazy_load_sub_driver_v2(sub_driver_name)
elseif version.api >= 9 then
return ZwaveDriver.lazy_load_sub_driver(require(sub_driver_name))
else
return require(sub_driver_name)
end

end
16 changes: 3 additions & 13 deletions drivers/SmartThings/zwave-window-treatment/src/preferences.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local devices = {
QUBINO = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local function can_handle_springs_window_fashion_shade(opts, driver, device, ...)
local FINGERPRINTS = require("springs-window-fashion-shade.fingerprints")
for _, fingerprint in ipairs(FINGERPRINTS) do
if device:id_match( fingerprint.mfr, fingerprint.prod, fingerprint.model) then
return true, require("springs-window-fashion-shade")
end
end
return false
end

return can_handle_springs_window_fashion_shade
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local SPRINGS_WINDOW_FINGERPRINTS = {
{mfr = 0x026E, prod = 0x4353, model = 0x5A31}, -- Springs Window Shade
{mfr = 0x026E, prod = 0x5253, model = 0x5A31}, -- Springs Roller Shade
}

return SPRINGS_WINDOW_FINGERPRINTS
Original file line number Diff line number Diff line change
@@ -1,41 +1,19 @@
-- Copyright 2022 SmartThings
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Copyright 2022 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0


local capabilities = require "st.capabilities"
--- @type st.zwave.constants
local constants = require "st.zwave.constants"
--- @type st.zwave.CommandClass.SwitchMultilevel
local SwitchMultilevel = (require "st.zwave.CommandClass.SwitchMultilevel")({version=4})

local SPRINGS_WINDOW_FINGERPRINTS = {
{mfr = 0x026E, prod = 0x4353, model = 0x5A31}, -- Springs Window Shade
{mfr = 0x026E, prod = 0x5253, model = 0x5A31}, -- Springs Roller Shade
}

--- Determine whether the passed device is springs window fashion shade
---
--- @param driver st.zwave.Driver
--- @param device st.zwave.Device
--- @return boolean true if the device is springs window fashion shade, else false
local function can_handle_springs_window_fashion_shade(opts, driver, device, ...)
for _, fingerprint in ipairs(SPRINGS_WINDOW_FINGERPRINTS) do
if device:id_match( fingerprint.mfr, fingerprint.prod, fingerprint.model) then
return true
end
end
return false
end

local function init_handler(self, device)
-- This device has a preset position set in hardware, so we need to override the base driver
Expand Down Expand Up @@ -77,7 +55,7 @@ local springs_window_fashion_shade = {
}
},
NAME = "Springs window fashion shade",
can_handle = can_handle_springs_window_fashion_shade,
can_handle = require("springs-window-fashion-shade.can_handle"),
}

return springs_window_fashion_shade
11 changes: 11 additions & 0 deletions drivers/SmartThings/zwave-window-treatment/src/sub_drivers.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Copyright 2025 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

local lazy_load_if_possible = require "lazy_load_subdriver"
local sub_drivers = {
lazy_load_if_possible("springs-window-fashion-shade"),
lazy_load_if_possible("iblinds-window-treatment"),
lazy_load_if_possible("window-treatment-venetian"),
lazy_load_if_possible("aeotec-nano-shutter"),
}
return sub_drivers
Loading
Loading