From 056ee617f8808810a0ba3d4f9fbd2965b621791f Mon Sep 17 00:00:00 2001 From: cjswedes Date: Fri, 10 Oct 2025 12:22:20 -0500 Subject: [PATCH 1/2] Enable use of lazy_load_subdriver_v2 in zigbee switch This is a new feature in api v16 that allows for more memory savings by more efficiently lazily loading the subdriver. Subdrivers must have their can_handle function and their own subdrivers split out into separate modules to work with the new lazy loading api. --- .../src/aqara-light/can_handle.lua | 14 ++ .../zigbee-switch/src/aqara-light/init.lua | 17 +-- .../zigbee-switch/src/aqara/can_handle.lua | 10 ++ .../zigbee-switch/src/aqara/fingerprints.lua | 19 +++ .../zigbee-switch/src/aqara/init.lua | 31 +---- .../src/aqara/multi-switch/can_handle.lua | 9 ++ .../src/aqara/multi-switch/fingerprints.lua | 11 ++ .../src/aqara/multi-switch/init.lua | 24 +--- .../zigbee-switch/src/aqara/sub_drivers.lua | 6 + .../src/aqara/version/can_handle.lua | 10 ++ .../zigbee-switch/src/aqara/version/init.lua | 5 +- .../src/bad_on_off_data_type/can_handle.lua | 21 +++ .../src/bad_on_off_data_type/init.lua | 24 +--- .../zigbee-switch/src/ezex/can_handle.lua | 14 ++ .../zigbee-switch/src/ezex/init.lua | 17 +-- .../zigbee-switch/src/frient/can_handle.lua | 11 ++ .../zigbee-switch/src/frient/fingerprints.lua | 14 ++ .../zigbee-switch/src/frient/init.lua | 29 +--- .../src/ge-link-bulb/can_handle.lua | 19 +++ .../zigbee-switch/src/ge-link-bulb/init.lua | 22 +-- .../zigbee-switch/src/hanssem/can_handle.lua | 10 ++ .../src/hanssem/fingerprints.lua | 8 ++ .../zigbee-switch/src/hanssem/init.lua | 24 +--- .../src/ikea-xy-color-bulb/can_handle.lua | 14 ++ .../src/ikea-xy-color-bulb/init.lua | 19 +-- .../SmartThings/zigbee-switch/src/init.lua | 13 +- .../zigbee-switch/src/inovelli/can_handle.lua | 14 ++ .../zigbee-switch/src/inovelli/init.lua | 23 +--- .../src/inovelli/sub_drivers.lua | 5 + .../src/inovelli/vzm32-sn/can_handle.lua | 13 ++ .../src/inovelli/vzm32-sn/init.lua | 16 +-- .../zigbee-switch/src/jasco/can_handle.lua | 15 +++ .../zigbee-switch/src/jasco/init.lua | 18 +-- .../zigbee-switch/src/laisiao/can_handle.lua | 13 ++ .../zigbee-switch/src/laisiao/init.lua | 14 +- .../zigbee-switch/src/lazy_load_subdriver.lua | 12 ++ .../src/multi-switch-no-master/can_handle.lua | 10 ++ .../multi-switch-no-master/fingerprints.lua | 43 ++++++ .../src/multi-switch-no-master/init.lua | 59 +------- .../src/non_zigbee_devices/can_handle.lua | 8 ++ .../src/non_zigbee_devices/init.lua | 11 +- .../zigbee-switch/src/rexense/can_handle.lua | 13 ++ .../zigbee-switch/src/rexense/init.lua | 16 +-- .../zigbee-switch/src/rgb-bulb/can_handle.lua | 20 +++ .../zigbee-switch/src/rgb-bulb/init.lua | 21 +-- .../src/rgbw-bulb/can_handle.lua | 10 ++ .../src/rgbw-bulb/fingerprints.lua | 71 ++++++++++ .../zigbee-switch/src/rgbw-bulb/init.lua | 84 +----------- .../zigbee-switch/src/robb/can_handle.lua | 14 ++ .../zigbee-switch/src/robb/init.lua | 17 +-- .../src/sinope-dimmer/can_handle.lua | 9 ++ .../zigbee-switch/src/sinope-dimmer/init.lua | 10 +- .../zigbee-switch/src/sinope/can_handle.lua | 9 ++ .../zigbee-switch/src/sinope/init.lua | 10 +- .../src/tuya-multi/can_handle.lua | 18 +++ .../zigbee-switch/src/tuya-multi/init.lua | 24 +--- .../zigbee-switch/src/wallhero/can_handle.lua | 11 ++ .../src/wallhero/fingerprints.lua | 8 ++ .../zigbee-switch/src/wallhero/init.lua | 22 +-- .../src/white-color-temp-bulb/can_handle.lua | 10 ++ .../duragreen/can_handle.lua | 15 +++ .../white-color-temp-bulb/duragreen/init.lua | 14 +- .../white-color-temp-bulb/fingerprints.lua | 96 +++++++++++++ .../src/white-color-temp-bulb/init.lua | 113 +--------------- .../src/white-color-temp-bulb/sub_drivers.lua | 4 + .../zigbee-dimmer-power-energy/can_handle.lua | 13 ++ .../src/zigbee-dimmer-power-energy/init.lua | 16 +-- .../src/zigbee-dimming-light/can_handle.lua | 10 ++ .../src/zigbee-dimming-light/fingerprints.lua | 33 +++++ .../src/zigbee-dimming-light/init.lua | 51 +------ .../osram-iqbr30/can_handle.lua | 7 + .../osram-iqbr30/init.lua | 6 +- .../src/zigbee-dimming-light/sub_drivers.lua | 6 + .../zll-dimmer/can_handle.lua | 9 ++ .../zll-dimmer/fingerprints.lua | 8 ++ .../zigbee-dimming-light/zll-dimmer/init.lua | 20 +-- .../can_handle.lua | 13 ++ .../src/zigbee-dual-metering-switch/init.lua | 16 +-- .../can_handle.lua | 9 ++ .../init.lua | 10 +- .../aurora-relay/can_handle.lua | 14 ++ .../zigbee-switch-power/aurora-relay/init.lua | 17 +-- .../src/zigbee-switch-power/can_handle.lua | 10 ++ .../src/zigbee-switch-power/fingerprints.lua | 15 +++ .../src/zigbee-switch-power/init.lua | 33 +---- .../src/zigbee-switch-power/sub_drivers.lua | 6 + .../zigbee-switch-power/vimar/can_handle.lua | 12 ++ .../src/zigbee-switch-power/vimar/init.lua | 15 +-- .../src/zll-dimmer-bulb/can_handle.lua | 10 ++ .../src/zll-dimmer-bulb/fingerprints.lua | 114 ++++++++++++++++ .../src/zll-dimmer-bulb/init.lua | 127 +----------------- .../src/zll-polling/can_handle.lua | 11 ++ .../zigbee-switch/src/zll-polling/init.lua | 15 +-- 93 files changed, 986 insertions(+), 968 deletions(-) create mode 100644 drivers/SmartThings/zigbee-switch/src/aqara-light/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/aqara/sub_drivers.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/aqara/version/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/ezex/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/frient/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/frient/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/ge-link-bulb/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/hanssem/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/hanssem/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/inovelli/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/inovelli/sub_drivers.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/jasco/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/laisiao/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/rexense/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/rgb-bulb/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/rgbw-bulb/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/rgbw-bulb/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/robb/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/sinope-dimmer/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/sinope/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/wallhero/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/wallhero/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/sub_drivers.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/sub_drivers.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/sub_drivers.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/can_handle.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/fingerprints.lua create mode 100644 drivers/SmartThings/zigbee-switch/src/zll-polling/can_handle.lua diff --git a/drivers/SmartThings/zigbee-switch/src/aqara-light/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara-light/can_handle.lua new file mode 100644 index 0000000000..1900934725 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/aqara-light/can_handle.lua @@ -0,0 +1,14 @@ +return function(opts, driver, device) + local FINGERPRINTS = { + { mfr = "LUMI", model = "lumi.light.acn004" }, + { mfr = "Aqara", model = "lumi.light.acn014" } + } + + for _, fingerprint in ipairs(FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("aqara-light") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua index 3009cb6d0c..ec6e178f42 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua @@ -12,21 +12,6 @@ local PRIVATE_CLUSTER_ID = 0xFCC0 local PRIVATE_ATTRIBUTE_ID = 0x0009 local MFG_CODE = 0x115F -local FINGERPRINTS = { - { mfr = "LUMI", model = "lumi.light.acn004" }, - { mfr = "Aqara", model = "lumi.light.acn014" } -} - -local function is_aqara_products(opts, driver, device) - for _, fingerprint in ipairs(FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("aqara-light") - return true, subdriver - end - end - return false -end - local function do_refresh(self, device) device:send(OnOff.attributes.OnOff:read(device)) device:send(Level.attributes.CurrentLevel:read(device)) @@ -65,7 +50,7 @@ local aqara_light_handler = { [capabilities.switchLevel.commands.setLevel.NAME] = set_level_handler } }, - can_handle = is_aqara_products + can_handle = require("aqara-light.can_handle"), } return aqara_light_handler diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua new file mode 100644 index 0000000000..312e3a7e08 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua @@ -0,0 +1,10 @@ +return function(opts, driver, device) + local FINGERPRINTS = require("aqara.fingerprints") + for _, fingerprint in ipairs(FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("aqara") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua new file mode 100644 index 0000000000..837b3243b8 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua @@ -0,0 +1,19 @@ +return { + { mfr = "LUMI", model = "lumi.plug.maeu01" }, + { mfr = "LUMI", model = "lumi.plug.macn01" }, + { mfr = "LUMI", model = "lumi.switch.n0agl1" }, + { mfr = "LUMI", model = "lumi.switch.l0agl1" }, + { mfr = "LUMI", model = "lumi.switch.n0acn2" }, + { mfr = "LUMI", model = "lumi.switch.n1acn1" }, + { mfr = "LUMI", model = "lumi.switch.n2acn1" }, + { mfr = "LUMI", model = "lumi.switch.n3acn1" }, + { mfr = "LUMI", model = "lumi.switch.b1laus01" }, + { mfr = "LUMI", model = "lumi.switch.b2laus01" }, + { mfr = "LUMI", model = "lumi.switch.n1aeu1" }, + { mfr = "LUMI", model = "lumi.switch.n2aeu1" }, + { mfr = "LUMI", model = "lumi.switch.l1aeu1" }, + { mfr = "LUMI", model = "lumi.switch.l2aeu1" }, + { mfr = "LUMI", model = "lumi.switch.b1nacn01" }, + { mfr = "LUMI", model = "lumi.switch.b2nacn01" }, + { mfr = "LUMI", model = "lumi.switch.b3n01" } + } diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/init.lua index 6558f7f282..c4acb83a94 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/init.lua @@ -24,26 +24,6 @@ local ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID = 0x000A local LAST_REPORT_TIME = "LAST_REPORT_TIME" local PRIVATE_MODE = "PRIVATE_MODE" -local FINGERPRINTS = { - { mfr = "LUMI", model = "lumi.plug.maeu01" }, - { mfr = "LUMI", model = "lumi.plug.macn01" }, - { mfr = "LUMI", model = "lumi.switch.n0agl1" }, - { mfr = "LUMI", model = "lumi.switch.l0agl1" }, - { mfr = "LUMI", model = "lumi.switch.n0acn2" }, - { mfr = "LUMI", model = "lumi.switch.n1acn1" }, - { mfr = "LUMI", model = "lumi.switch.n2acn1" }, - { mfr = "LUMI", model = "lumi.switch.n3acn1" }, - { mfr = "LUMI", model = "lumi.switch.b1laus01" }, - { mfr = "LUMI", model = "lumi.switch.b2laus01" }, - { mfr = "LUMI", model = "lumi.switch.n1aeu1" }, - { mfr = "LUMI", model = "lumi.switch.n2aeu1" }, - { mfr = "LUMI", model = "lumi.switch.l1aeu1" }, - { mfr = "LUMI", model = "lumi.switch.l2aeu1" }, - { mfr = "LUMI", model = "lumi.switch.b1nacn01" }, - { mfr = "LUMI", model = "lumi.switch.b2nacn01" }, - { mfr = "LUMI", model = "lumi.switch.b3n01" } -} - local preference_map = { ["stse.restorePowerState"] = { cluster_id = PRIVATE_CLUSTER_ID, @@ -137,15 +117,6 @@ local preference_map = { }, } -local function is_aqara_products(opts, driver, device) - for _, fingerprint in ipairs(FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("aqara") - return true, subdriver - end - end - return false -end local function private_mode_handler(driver, device, value, zb_rx) device:set_field(PRIVATE_MODE, value.value, { persist = true }) @@ -286,7 +257,7 @@ local aqara_switch_handler = { require("aqara.version"), require("aqara.multi-switch") }, - can_handle = is_aqara_products + can_handle = require("aqara.can_handle"), } return aqara_switch_handler diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua new file mode 100644 index 0000000000..26eb425583 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua @@ -0,0 +1,9 @@ +return function(opts, driver, device) + local FINGERPRINTS = require("aqara.multi-switch.fingerprints") + for _, fingerprint in ipairs(FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + return true, require("aqara.multi-switch") + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua new file mode 100644 index 0000000000..e8bfe86866 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua @@ -0,0 +1,11 @@ +return { + { mfr = "LUMI", model = "lumi.switch.n1acn1", children = 1, child_profile = "" }, + { mfr = "LUMI", model = "lumi.switch.n2acn1", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.n3acn1", children = 3, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.b1laus01", children = 1, child_profile = "" }, + { mfr = "LUMI", model = "lumi.switch.b2laus01", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.l2aeu1", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.n2aeu1", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.b2nacn01", children = 2, child_profile = "aqara-switch-child" }, + { mfr = "LUMI", model = "lumi.switch.b3n01", children = 3, child_profile = "aqara-switch-child" } +} diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua index 4e54b67e2f..cf143091e7 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua @@ -8,27 +8,7 @@ local switch_utils = require "switch_utils" local PRIVATE_CLUSTER_ID = 0xFCC0 local PRIVATE_ATTRIBUTE_ID = 0x0009 local MFG_CODE = 0x115F - -local FINGERPRINTS = { - { mfr = "LUMI", model = "lumi.switch.n1acn1", children = 1, child_profile = "" }, - { mfr = "LUMI", model = "lumi.switch.n2acn1", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.n3acn1", children = 3, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.b1laus01", children = 1, child_profile = "" }, - { mfr = "LUMI", model = "lumi.switch.b2laus01", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.l2aeu1", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.n2aeu1", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.b2nacn01", children = 2, child_profile = "aqara-switch-child" }, - { mfr = "LUMI", model = "lumi.switch.b3n01", children = 3, child_profile = "aqara-switch-child" } -} - -local function is_aqara_products(opts, driver, device) - for _, fingerprint in ipairs(FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - return true - end - end - return false -end +local FINGERPRINTS = require("aqara.multi-switch.fingerprints") local function get_children_amount(device) for _, fingerprint in ipairs(FINGERPRINTS) do @@ -106,7 +86,7 @@ local aqara_multi_switch_handler = { init = configurations.power_reconfig_wrapper(device_init), added = device_added }, - can_handle = is_aqara_products + can_handle = require("aqara.multi-switch.can_handle"), } return aqara_multi_switch_handler diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/aqara/sub_drivers.lua new file mode 100644 index 0000000000..cf4fec5466 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/aqara/sub_drivers.lua @@ -0,0 +1,6 @@ +local lazy_load = require "lazy_load_subdriver" + +return { + lazy_load("aqara.multi-switch"), + lazy_load("aqara.version"), +} diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/version/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara/version/can_handle.lua new file mode 100644 index 0000000000..780b53a434 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/aqara/version/can_handle.lua @@ -0,0 +1,10 @@ +return function (opts, driver, device) + local PRIVATE_MODE = "PRIVATE_MODE" + local private_mode = device:get_field(PRIVATE_MODE) or 0 + local res = private_mode == 1 + if res then + return res, require("aqara.version") + else + return res + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua index 01767da106..6e3b5ab125 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua @@ -102,10 +102,7 @@ local aqara_switch_version_handler = { } } }, - can_handle = function (opts, driver, device) - local private_mode = device:get_field(PRIVATE_MODE) or 0 - return private_mode == 1 - end + can_handle = require("aqara.version.can_handle") } return aqara_switch_version_handler diff --git a/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/can_handle.lua new file mode 100644 index 0000000000..7b9510968d --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/can_handle.lua @@ -0,0 +1,21 @@ + +-- There are reports of at least one device (SONOFF 01MINIZB) which occasionally +-- reports this value as an Int8, rather than a Boolean, as per the spec +return function(opts, driver, device, zb_rx, ...) + local zcl_clusters = require "st.zigbee.zcl.clusters" + local data_types = require "st.zigbee.data_types" + local can_handle = opts.dispatcher_class == "ZigbeeMessageDispatcher" and + device:get_manufacturer() == "SONOFF" and + zb_rx.body and + zb_rx.body.zcl_body and + zb_rx.body.zcl_body.attr_records and + zb_rx.address_header.cluster.value == zcl_clusters.OnOff.ID and + zb_rx.body.zcl_body.attr_records[1].attr_id.value == zcl_clusters.OnOff.attributes.OnOff.ID and + zb_rx.body.zcl_body.attr_records[1].data_type.value ~= data_types.Boolean.ID + if can_handle then + local subdriver = require("bad_on_off_data_type") + return true, subdriver + else + return false + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/init.lua b/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/init.lua index ee0c82977e..863d1e4ec4 100644 --- a/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/init.lua @@ -13,28 +13,8 @@ -- limitations under the License. local zcl_clusters = require "st.zigbee.zcl.clusters" -local data_types = require "st.zigbee.data_types" local capabilities = require "st.capabilities" --- There are reports of at least one device (SONOFF 01MINIZB) which occasionally --- reports this value as an Int8, rather than a Boolean, as per the spec -local function incorrect_data_type_detected(opts, driver, device, zb_rx, ...) - local can_handle = opts.dispatcher_class == "ZigbeeMessageDispatcher" and - device:get_manufacturer() == "SONOFF" and - zb_rx.body and - zb_rx.body.zcl_body and - zb_rx.body.zcl_body.attr_records and - zb_rx.address_header.cluster.value == zcl_clusters.OnOff.ID and - zb_rx.body.zcl_body.attr_records[1].attr_id.value == zcl_clusters.OnOff.attributes.OnOff.ID and - zb_rx.body.zcl_body.attr_records[1].data_type.value ~= data_types.Boolean.ID - if can_handle then - local subdriver = require("bad_on_off_data_type") - return true, subdriver - else - return false - end -end - local function on_off_attr_handler(driver, device, value, zb_rx) local attr = capabilities.switch.switch device:emit_event_for_endpoint(zb_rx.address_header.src_endpoint.value, value.value == 0 and attr.off() or attr.on()) @@ -49,7 +29,7 @@ local bad_on_off_data_type = { } } }, - can_handle = incorrect_data_type_detected + can_handle = require("bad_on_off_data_type.can_handle"), } -return bad_on_off_data_type \ No newline at end of file +return bad_on_off_data_type diff --git a/drivers/SmartThings/zigbee-switch/src/ezex/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/ezex/can_handle.lua new file mode 100644 index 0000000000..454f140209 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/ezex/can_handle.lua @@ -0,0 +1,14 @@ +return function(opts, driver, device) + local ZIGBEE_METERING_SWITCH_FINGERPRINTS = { + { model = "E240-KR116Z-HA" } + } + + for _, fingerprint in ipairs(ZIGBEE_METERING_SWITCH_FINGERPRINTS) do + if device:get_model() == fingerprint.model then + local subdriver = require("ezex") + return true, subdriver + end + end + + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/ezex/init.lua b/drivers/SmartThings/zigbee-switch/src/ezex/init.lua index f88c39bb75..7f338e1b11 100644 --- a/drivers/SmartThings/zigbee-switch/src/ezex/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/ezex/init.lua @@ -15,21 +15,6 @@ local zigbee_constants = require "st.zigbee.constants" local configurations = require "configurations" -local ZIGBEE_METERING_SWITCH_FINGERPRINTS = { - { model = "E240-KR116Z-HA" } -} - -local is_zigbee_ezex_switch = function(opts, driver, device) - for _, fingerprint in ipairs(ZIGBEE_METERING_SWITCH_FINGERPRINTS) do - if device:get_model() == fingerprint.model then - local subdriver = require("ezex") - return true, subdriver - end - end - - return false -end - local do_init = function(self, device) device:set_field(zigbee_constants.SIMPLE_METERING_DIVISOR_KEY, 1000000, {persist = true}) device:set_field(zigbee_constants.ELECTRICAL_MEASUREMENT_DIVISOR_KEY, 1000, {persist = true}) @@ -40,7 +25,7 @@ local ezex_switch_handler = { lifecycle_handlers = { init = configurations.power_reconfig_wrapper(do_init) }, - can_handle = is_zigbee_ezex_switch + can_handle = require("ezex.can_handle"), } return ezex_switch_handler diff --git a/drivers/SmartThings/zigbee-switch/src/frient/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/frient/can_handle.lua new file mode 100644 index 0000000000..1c23272f30 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/frient/can_handle.lua @@ -0,0 +1,11 @@ +-- Function to determine if the driver can handle this device +return function(opts, driver, device, ...) + local FRIENT_SMART_PLUG_FINGERPRINTS = require("frient.fingerprints") + for _, fingerprint in ipairs(FRIENT_SMART_PLUG_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("frient") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/frient/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/frient/fingerprints.lua new file mode 100644 index 0000000000..a9c7333473 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/frient/fingerprints.lua @@ -0,0 +1,14 @@ +return { + { mfr = "frient A/S", model = "SPLZB-131" }, + { mfr = "frient A/S", model = "SPLZB-132" }, + { mfr = "frient A/S", model = "SPLZB-134" }, + { mfr = "frient A/S", model = "SPLZB-137" }, + { mfr = "frient A/S", model = "SPLZB-141" }, + { mfr = "frient A/S", model = "SPLZB-142" }, + { mfr = "frient A/S", model = "SPLZB-144" }, + { mfr = "frient A/S", model = "SPLZB-147" }, + { mfr = "frient A/S", model = "SMRZB-143" }, + { mfr = "frient A/S", model = "SMRZB-153" }, + { mfr = "frient A/S", model = "SMRZB-332" }, + { mfr = "frient A/S", model = "SMRZB-342" }, +} diff --git a/drivers/SmartThings/zigbee-switch/src/frient/init.lua b/drivers/SmartThings/zigbee-switch/src/frient/init.lua index c075fa9320..af85f237a6 100644 --- a/drivers/SmartThings/zigbee-switch/src/frient/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/frient/init.lua @@ -27,20 +27,6 @@ local VOLTAGE_MEASUREMENT_DIVISOR_KEY = "_voltage_measurement_divisor" local CURRENT_MEASUREMENT_MULTIPLIER_KEY = "_current_measurement_multiplier" local CURRENT_MEASUREMENT_DIVISOR_KEY = "_current_measurement_divisor" -local FRIENT_SMART_PLUG_FINGERPRINTS = { - { mfr = "frient A/S", model = "SPLZB-131" }, - { mfr = "frient A/S", model = "SPLZB-132" }, - { mfr = "frient A/S", model = "SPLZB-134" }, - { mfr = "frient A/S", model = "SPLZB-137" }, - { mfr = "frient A/S", model = "SPLZB-141" }, - { mfr = "frient A/S", model = "SPLZB-142" }, - { mfr = "frient A/S", model = "SPLZB-144" }, - { mfr = "frient A/S", model = "SPLZB-147" }, - { mfr = "frient A/S", model = "SMRZB-143" }, - { mfr = "frient A/S", model = "SMRZB-153" }, - { mfr = "frient A/S", model = "SMRZB-332" }, - { mfr = "frient A/S", model = "SMRZB-342" }, -} local POWER_FAILURE_ALARM_CODE = 0x03 @@ -156,17 +142,6 @@ local function do_configure(driver, device) device:refresh() end --- Function to determine if the driver can handle this device -local function can_handle_frient_smart_plug(opts, driver, device, ...) - for _, fingerprint in ipairs(FRIENT_SMART_PLUG_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("frient") - return true, subdriver - end - end - return false -end - -- Main driver definition local frient_smart_plug = { NAME = "frient Smart Plug", @@ -192,7 +167,7 @@ local frient_smart_plug = { doConfigure = do_configure, added = device_added, }, - can_handle = can_handle_frient_smart_plug + can_handle = require("frient.can_handle"), } -return frient_smart_plug \ No newline at end of file +return frient_smart_plug diff --git a/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/can_handle.lua new file mode 100644 index 0000000000..08ce9c471f --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/can_handle.lua @@ -0,0 +1,19 @@ +return function(opts, driver, device) + local GE_LINK_BULB_FINGERPRINTS = { + ["GE_Appliances"] = { + ["ZLL Light"] = true, + }, + ["GE"] = { + ["Daylight"] = true, + ["SoftWhite"] = true + } +} + + local can_handle = (GE_LINK_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] + if can_handle then + local subdriver = require("ge-link-bulb") + return true, subdriver + else + return false + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua index 3bf3fa8952..51bab5110f 100644 --- a/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua @@ -17,26 +17,6 @@ local capabilities = require "st.capabilities" local Level = clusters.Level -local GE_LINK_BULB_FINGERPRINTS = { - ["GE_Appliances"] = { - ["ZLL Light"] = true, - }, - ["GE"] = { - ["Daylight"] = true, - ["SoftWhite"] = true - } -} - -local function can_handle_ge_link_bulb(opts, driver, device) - local can_handle = (GE_LINK_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] - if can_handle then - local subdriver = require("ge-link-bulb") - return true, subdriver - else - return false - end -end - local function info_changed(driver, device, event, args) local command local new_dim_onoff_value = tonumber(device.preferences.dimOnOff) @@ -81,7 +61,7 @@ local ge_link_bulb = { [capabilities.switchLevel.commands.setLevel.NAME] = set_level_handler } }, - can_handle = can_handle_ge_link_bulb + can_handle = require("ge-link-bulb.can_handle"), } return ge_link_bulb diff --git a/drivers/SmartThings/zigbee-switch/src/hanssem/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/hanssem/can_handle.lua new file mode 100644 index 0000000000..de9c477317 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/hanssem/can_handle.lua @@ -0,0 +1,10 @@ +return function(opts, driver, device, ...) + local FINGERPRINTS = require "hanssem.fingerprints" + for _, fingerprint in ipairs(FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("hanssem") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/hanssem/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/hanssem/fingerprints.lua new file mode 100644 index 0000000000..67d2f40022 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/hanssem/fingerprints.lua @@ -0,0 +1,8 @@ +return { + { mfr = "Winners", model = "LSS1-101", children = 0 }, + { mfr = "Winners", model = "LSS1-102", children = 1 }, + { mfr = "Winners", model = "LSS1-103", children = 2 }, + { mfr = "Winners", model = "LSS1-204", children = 3 }, + { mfr = "Winners", model = "LSS1-205", children = 4 }, + { mfr = "Winners", model = "LSS1-206", children = 5 } +} diff --git a/drivers/SmartThings/zigbee-switch/src/hanssem/init.lua b/drivers/SmartThings/zigbee-switch/src/hanssem/init.lua index bb845984ca..e1f9939946 100644 --- a/drivers/SmartThings/zigbee-switch/src/hanssem/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/hanssem/init.lua @@ -15,26 +15,8 @@ local stDevice = require "st.device" local configurations = require "configurations" -local FINGERPRINTS = { - { mfr = "Winners", model = "LSS1-101", children = 0 }, - { mfr = "Winners", model = "LSS1-102", children = 1 }, - { mfr = "Winners", model = "LSS1-103", children = 2 }, - { mfr = "Winners", model = "LSS1-204", children = 3 }, - { mfr = "Winners", model = "LSS1-205", children = 4 }, - { mfr = "Winners", model = "LSS1-206", children = 5 } -} - -local function can_handle_hanssem_switch(opts, driver, device, ...) - for _, fingerprint in ipairs(FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("hanssem") - return true, subdriver - end - end - return false -end - local function get_children_amount(device) + local FINGERPRINTS = require "hanssem.fingerprints" for _, fingerprint in ipairs(FINGERPRINTS) do if device:get_model() == fingerprint.model then return fingerprint.children @@ -81,7 +63,7 @@ local HanssemSwitch = { added = device_added, init = configurations.power_reconfig_wrapper(device_init) }, - can_handle = can_handle_hanssem_switch + can_handle = require("hanssem.can_handle"), } -return HanssemSwitch \ No newline at end of file +return HanssemSwitch diff --git a/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/can_handle.lua new file mode 100644 index 0000000000..3c507a2627 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/can_handle.lua @@ -0,0 +1,14 @@ + +return function(opts, driver, device) + local IKEA_XY_COLOR_BULB_FINGERPRINTS = { + ["IKEA of Sweden"] = { + ["TRADFRI bulb E27 CWS opal 600lm"] = true, + ["TRADFRI bulb E26 CWS opal 600lm"] = true + } + } + local res = (IKEA_XY_COLOR_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] + if res then + return res, require("ikea-xy-color-bulb") + end + return res +end diff --git a/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/init.lua index b7080ad446..193d032336 100644 --- a/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/init.lua @@ -27,23 +27,6 @@ local HUESAT_TIMER = "huesat_timer" local TARGET_HUE = "target_hue" local TARGET_SAT = "target_sat" -local IKEA_XY_COLOR_BULB_FINGERPRINTS = { - ["IKEA of Sweden"] = { - ["TRADFRI bulb E27 CWS opal 600lm"] = true, - ["TRADFRI bulb E26 CWS opal 600lm"] = true - } -} - -local function can_handle_ikea_xy_color_bulb(opts, driver, device) - local can_handle = (IKEA_XY_COLOR_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] - if can_handle then - local subdriver = require("ikea-xy-color-bulb") - return true, subdriver - else - return false - end -end - local device_init = function(self, device) device:remove_configured_attribute(ColorControl.ID, ColorControl.attributes.CurrentHue.ID) device:remove_configured_attribute(ColorControl.ID, ColorControl.attributes.CurrentSaturation.ID) @@ -192,7 +175,7 @@ local ikea_xy_color_bulb = { } } }, - can_handle = can_handle_ikea_xy_color_bulb + can_handle = require("ikea-xy-color-bulb.can_handle") } return ikea_xy_color_bulb diff --git a/drivers/SmartThings/zigbee-switch/src/init.lua b/drivers/SmartThings/zigbee-switch/src/init.lua index dfaba9e573..8a7a05a9cb 100644 --- a/drivers/SmartThings/zigbee-switch/src/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/init.lua @@ -29,17 +29,6 @@ else lazy_handler = require end -local function lazy_load_if_possible(sub_driver_name) - -- gets the current lua libs api version - -- version 9 will include the lazy loading functions - if version.api >= 9 then - return ZigbeeDriver.lazy_load_sub_driver(require(sub_driver_name)) - else - return require(sub_driver_name) - end - -end - local function component_to_endpoint(device, component_id) local ep_num = component_id:match("switch(%d)") return ep_num and tonumber(ep_num) or device.fingerprinted_endpoint_id @@ -76,6 +65,8 @@ local device_init = function(driver, device) end end +local lazy_load_if_possible = require "lazy_load_subdriver" + local zigbee_switch_driver_template = { supported_capabilities = { capabilities.switch, diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/can_handle.lua new file mode 100644 index 0000000000..325c2bc973 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/can_handle.lua @@ -0,0 +1,14 @@ + +return function(opts, driver, device) + local INOVELLI_FINGERPRINTS = { + { mfr = "Inovelli", model = "VZM31-SN" }, + { mfr = "Inovelli", model = "VZM32-SN" } + } + for _, fp in ipairs(INOVELLI_FINGERPRINTS) do + if device:get_manufacturer() == fp.mfr and device:get_model() == fp.model then + local subdriver = require("inovelli") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua index 253dcca86c..dd261cdd8a 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua @@ -25,11 +25,6 @@ local OccupancySensing = clusters.OccupancySensing local LATEST_CLOCK_SET_TIMESTAMP = "latest_clock_set_timestamp" -local INOVELLI_FINGERPRINTS = { - { mfr = "Inovelli", model = "VZM31-SN" }, - { mfr = "Inovelli", model = "VZM32-SN" } -} - local PRIVATE_CLUSTER_ID = 0xFC31 local PRIVATE_CLUSTER_MMWAVE_ID = 0xFC32 local PRIVATE_CMD_NOTIF_ID = 0x01 @@ -112,16 +107,6 @@ local preferences_calculate_parameter = function(new_value, type, number) end end -local can_handle_inovelli = function(opts, driver, device) - for _, fp in ipairs(INOVELLI_FINGERPRINTS) do - if device:get_manufacturer() == fp.mfr and device:get_model() == fp.model then - local subdriver = require("inovelli") - return true, subdriver - end - end - return false -end - local function to_boolean(value) if value == 0 or value == "0" then return false @@ -379,9 +364,7 @@ local inovelli = { } } }, - sub_drivers = { - require("inovelli/vzm32-sn"), - }, + sub_drivers = require("inovelli.sub_drivers"), capability_handlers = { [capabilities.switch.ID] = { [capabilities.switch.commands.on.NAME] = on_handler, @@ -400,7 +383,7 @@ local inovelli = { [capabilities.energyMeter.commands.resetEnergyMeter.NAME] = handle_resetEnergyMeter, } }, - can_handle = can_handle_inovelli + can_handle = require("inovelli.can_handle"), } -return inovelli \ No newline at end of file +return inovelli diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/sub_drivers.lua new file mode 100644 index 0000000000..c7f0c32bfc --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/sub_drivers.lua @@ -0,0 +1,5 @@ +local lazy_load = require "lazy_load_subdriver" + +return { + lazy_load("inovelli.vzm32-sn") +} diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/can_handle.lua new file mode 100644 index 0000000000..e2496028a3 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/can_handle.lua @@ -0,0 +1,13 @@ + +return function(opts, driver, device) + local INOVELLI_VZM32_SN_FINGERPRINTS = { + { mfr = "Inovelli", model = "VZM32-SN" }, + } + for _, fp in ipairs(INOVELLI_VZM32_SN_FINGERPRINTS) do + if device:get_manufacturer() == fp.mfr and device:get_model() == fp.model then + local sub_driver = require("inovelli.vzm32-sn") + return true, sub_driver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua index 2be05dad3e..6b46885553 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua @@ -20,21 +20,9 @@ local inovelli_common = require "inovelli.common" local OccupancySensing = clusters.OccupancySensing -local INOVELLI_VZM32_SN_FINGERPRINTS = { - { mfr = "Inovelli", model = "VZM32-SN" }, -} - local PRIVATE_CLUSTER_ID = 0xFC31 local MFG_CODE = 0x122F -local function can_handle_inovelli_vzm32_sn(opts, driver, device) - for _, fp in ipairs(INOVELLI_VZM32_SN_FINGERPRINTS) do - if device:get_manufacturer() == fp.mfr and device:get_model() == fp.model then - return true - end - end - return false -end local function configure_illuminance_reporting(device) local min_lux_change = 15 @@ -43,7 +31,7 @@ local function configure_illuminance_reporting(device) end local function refresh_handler(driver, device, command) - if device.network_type ~= device.NETWORK_TYPE_CHILD then + if device.network_type ~= st_device.NETWORK_TYPE_CHILD then device:refresh() device:send(OccupancySensing.attributes.Occupancy:read(device)) else @@ -76,7 +64,7 @@ end local vzm32_sn = { NAME = "inovelli vzm32-sn device-specific", - can_handle = can_handle_inovelli_vzm32_sn, + can_handle = require("inovelli.vzm32-sn.can_handle"), lifecycle_handlers = { added = device_added, doConfigure = device_configure, diff --git a/drivers/SmartThings/zigbee-switch/src/jasco/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/jasco/can_handle.lua new file mode 100644 index 0000000000..be9bd75694 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/jasco/can_handle.lua @@ -0,0 +1,15 @@ +return function(opts, driver, device) + local JASCO_SWTICH_FINGERPRINTS = { + { mfr = "Jasco Products", model = "43095" }, + { mfr = "Jasco Products", model = "43132" }, + { mfr = "Jasco Products", model = "43078" } +} + + for _, fingerprint in ipairs(JASCO_SWTICH_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("jasco") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/jasco/init.lua b/drivers/SmartThings/zigbee-switch/src/jasco/init.lua index 6c90115a22..250903d46a 100644 --- a/drivers/SmartThings/zigbee-switch/src/jasco/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/jasco/init.lua @@ -17,22 +17,6 @@ local capabilities = require "st.capabilities" local SimpleMetering = clusters.SimpleMetering local constants = require "st.zigbee.constants" -local JASCO_SWTICH_FINGERPRINTS = { - { mfr = "Jasco Products", model = "43095" }, - { mfr = "Jasco Products", model = "43132" }, - { mfr = "Jasco Products", model = "43078" } -} - -local is_jasco_switch = function(opts, driver, device) - for _, fingerprint in ipairs(JASCO_SWTICH_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("jasco") - return true, subdriver - end - end - return false -end - local device_added = function(self, device) local customEnergyDivisor = 10000 device:set_field(constants.SIMPLE_METERING_DIVISOR_KEY, customEnergyDivisor, {persist = true}) @@ -63,7 +47,7 @@ local jasco_switch = { added = device_added, doConfigure = do_configure, }, - can_handle = is_jasco_switch + can_handle = require("jasco.can_handle"), } return jasco_switch diff --git a/drivers/SmartThings/zigbee-switch/src/laisiao/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/laisiao/can_handle.lua new file mode 100644 index 0000000000..991547f9d1 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/laisiao/can_handle.lua @@ -0,0 +1,13 @@ +return function(opts, driver, device, ...) +local FINGERPRINTS = { + { mfr = "LAISIAO", model = "yuba" }, +} + + for _, fingerprint in ipairs(FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("laisiao") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua b/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua index edb829bf1f..5a26e01f34 100755 --- a/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua @@ -16,19 +16,7 @@ local capabilities = require "st.capabilities" local zcl_clusters = require "st.zigbee.zcl.clusters" local configurations = require "configurations" -local FINGERPRINTS = { - { mfr = "LAISIAO", model = "yuba" }, -} -local function can_handle_laisiao(opts, driver, device, ...) - for _, fingerprint in ipairs(FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("laisiao") - return true, subdriver - end - end - return false -end local function component_to_endpoint(device, component_id) if component_id == "main" then @@ -78,7 +66,7 @@ local laisiao_bath_heater = { [capabilities.switch.commands.on.NAME] = on_handler } }, - can_handle = can_handle_laisiao + can_handle = require("laisiao.can_handle"), } return laisiao_bath_heater diff --git a/drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua b/drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua new file mode 100644 index 0000000000..80dc2101ae --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua @@ -0,0 +1,12 @@ +return function(sub_driver_name) + -- gets the current lua libs api version + local version = require "version" + local ZigbeeDriver = require "st.zigbee" + if version.api >= 16 then + return ZigbeeDriver.lazy_load_sub_driver_v2(sub_driver_name) + elseif version.api >= 9 then + return ZigbeeDriver.lazy_load_sub_driver(require(sub_driver_name)) + else + return require(sub_driver_name) + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/can_handle.lua new file mode 100644 index 0000000000..d780d70d06 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/can_handle.lua @@ -0,0 +1,10 @@ +return function(opts, driver, device) + local FINGERPRINTS = require "multi-switch-no-master.fingerprints" + for _, fingerprint in ipairs(FINGERPRINTS) do + if device:get_model() == fingerprint.model and (device:get_manufacturer() == nil or device:get_manufacturer() == fingerprint.mfr) then + local subdriver = require("multi-switch-no-master") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/fingerprints.lua new file mode 100644 index 0000000000..f8bb368525 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/fingerprints.lua @@ -0,0 +1,43 @@ +return { + { mfr = "DAWON_DNS", model = "PM-S240-ZB", children = 1 }, + { mfr = "DAWON_DNS", model = "PM-S240R-ZB", children = 1 }, + { mfr = "DAWON_DNS", model = "PM-S250-ZB", children = 1 }, + { mfr = "DAWON_DNS", model = "PM-S340-ZB", children = 2 }, + { mfr = "DAWON_DNS", model = "PM-S340R-ZB", children = 2 }, + { mfr = "DAWON_DNS", model = "PM-S350-ZB", children = 2 }, + { mfr = "DAWON_DNS", model = "ST-S250-ZB", children = 1 }, + { mfr = "DAWON_DNS", model = "ST-S350-ZB", children = 2 }, + { mfr = "ORVIBO", model = "074b3ffba5a045b7afd94c47079dd553", children = 1 }, + { mfr = "ORVIBO", model = "9f76c9f31b4c4a499e3aca0977ac4494", children = 2 }, + { mfr = "REXENSE", model = "HY0002", children = 1 }, + { mfr = "REXENSE", model = "HY0003", children = 2 }, + { mfr = "REX", model = "HY0096", children = 1 }, + { mfr = "REX", model = "HY0097", children = 2 }, + { mfr = "HEIMAN", model = "HS2SW2L-EFR-3.0", children = 1 }, + { mfr = "HEIMAN", model = "HS2SW3L-EFR-3.0", children = 2 }, + { mfr = "HEIMAN", model = "HS6SW2A-W-EF-3.0", children = 1 }, + { mfr = "HEIMAN", model = "HS6SW3A-W-EF-3.0", children = 2 }, + { mfr = "eWeLink", model = "ZB-SW02", children = 1 }, + { mfr = "eWeLink", model = "ZB-SW03", children = 2 }, + { mfr = "eWeLink", model = "ZB-SW04", children = 3 }, + { mfr = "SMARTvill", model = "SLA01", children = 0 }, + { mfr = "SMARTvill", model = "SLA02", children = 1 }, + { mfr = "SMARTvill", model = "SLA03", children = 2 }, + { mfr = "SMARTvill", model = "SLA04", children = 3 }, + { mfr = "SMARTvill", model = "SLA05", children = 4 }, + { mfr = "SMARTvill", model = "SLA06", children = 5 }, + { mfr = "ShinaSystem", model = "SBM300Z2", children = 1 }, + { mfr = "ShinaSystem", model = "SBM300Z3", children = 2 }, + { mfr = "ShinaSystem", model = "SBM300Z4", children = 3 }, + { mfr = "ShinaSystem", model = "SBM300Z5", children = 4 }, + { mfr = "ShinaSystem", model = "SBM300Z6", children = 5 }, + { mfr = "ShinaSystem", model = "SQM300Z2", children = 1 }, + { mfr = "ShinaSystem", model = "SQM300Z3", children = 2 }, + { mfr = "ShinaSystem", model = "SQM300Z4", children = 3 }, + { mfr = "ShinaSystem", model = "SQM300Z6", children = 5 }, + { model = "E220-KR2N0Z0-HA", children = 1 }, + { model = "E220-KR3N0Z0-HA", children = 2 }, + { model = "E220-KR4N0Z0-HA", children = 3 }, + { model = "E220-KR5N0Z0-HA", children = 4 }, + { model = "E220-KR6N0Z0-HA", children = 5 } +} diff --git a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua index bec5b1d87d..85bfb6ae96 100644 --- a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua @@ -15,62 +15,8 @@ local st_device = require "st.device" local utils = require "st.utils" local configurations = require "configurations" -local MULTI_SWITCH_NO_MASTER_FINGERPRINTS = { - { mfr = "DAWON_DNS", model = "PM-S240-ZB", children = 1 }, - { mfr = "DAWON_DNS", model = "PM-S240R-ZB", children = 1 }, - { mfr = "DAWON_DNS", model = "PM-S250-ZB", children = 1 }, - { mfr = "DAWON_DNS", model = "PM-S340-ZB", children = 2 }, - { mfr = "DAWON_DNS", model = "PM-S340R-ZB", children = 2 }, - { mfr = "DAWON_DNS", model = "PM-S350-ZB", children = 2 }, - { mfr = "DAWON_DNS", model = "ST-S250-ZB", children = 1 }, - { mfr = "DAWON_DNS", model = "ST-S350-ZB", children = 2 }, - { mfr = "ORVIBO", model = "074b3ffba5a045b7afd94c47079dd553", children = 1 }, - { mfr = "ORVIBO", model = "9f76c9f31b4c4a499e3aca0977ac4494", children = 2 }, - { mfr = "REXENSE", model = "HY0002", children = 1 }, - { mfr = "REXENSE", model = "HY0003", children = 2 }, - { mfr = "REX", model = "HY0096", children = 1 }, - { mfr = "REX", model = "HY0097", children = 2 }, - { mfr = "HEIMAN", model = "HS2SW2L-EFR-3.0", children = 1 }, - { mfr = "HEIMAN", model = "HS2SW3L-EFR-3.0", children = 2 }, - { mfr = "HEIMAN", model = "HS6SW2A-W-EF-3.0", children = 1 }, - { mfr = "HEIMAN", model = "HS6SW3A-W-EF-3.0", children = 2 }, - { mfr = "eWeLink", model = "ZB-SW02", children = 1 }, - { mfr = "eWeLink", model = "ZB-SW03", children = 2 }, - { mfr = "eWeLink", model = "ZB-SW04", children = 3 }, - { mfr = "SMARTvill", model = "SLA01", children = 0 }, - { mfr = "SMARTvill", model = "SLA02", children = 1 }, - { mfr = "SMARTvill", model = "SLA03", children = 2 }, - { mfr = "SMARTvill", model = "SLA04", children = 3 }, - { mfr = "SMARTvill", model = "SLA05", children = 4 }, - { mfr = "SMARTvill", model = "SLA06", children = 5 }, - { mfr = "ShinaSystem", model = "SBM300Z2", children = 1 }, - { mfr = "ShinaSystem", model = "SBM300Z3", children = 2 }, - { mfr = "ShinaSystem", model = "SBM300Z4", children = 3 }, - { mfr = "ShinaSystem", model = "SBM300Z5", children = 4 }, - { mfr = "ShinaSystem", model = "SBM300Z6", children = 5 }, - { mfr = "ShinaSystem", model = "SQM300Z2", children = 1 }, - { mfr = "ShinaSystem", model = "SQM300Z3", children = 2 }, - { mfr = "ShinaSystem", model = "SQM300Z4", children = 3 }, - { mfr = "ShinaSystem", model = "SQM300Z6", children = 5 }, - { model = "E220-KR2N0Z0-HA", children = 1 }, - { model = "E220-KR3N0Z0-HA", children = 2 }, - { model = "E220-KR4N0Z0-HA", children = 3 }, - { model = "E220-KR5N0Z0-HA", children = 4 }, - { model = "E220-KR6N0Z0-HA", children = 5 } -} - -local function is_multi_switch_no_master(opts, driver, device) - for _, fingerprint in ipairs(MULTI_SWITCH_NO_MASTER_FINGERPRINTS) do - if device:get_model() == fingerprint.model and (device:get_manufacturer() == nil or device:get_manufacturer() == fingerprint.mfr) then - local subdriver = require("multi-switch-no-master") - return true, subdriver - end - end - return false -end - local function get_children_amount(device) - for _, fingerprint in ipairs(MULTI_SWITCH_NO_MASTER_FINGERPRINTS) do + for _, fingerprint in ipairs(require("multi-switch-no-master.fingerprints")) do if device:get_model() == fingerprint.model then return fingerprint.children end @@ -117,8 +63,7 @@ local multi_switch_no_master = { init = configurations.power_reconfig_wrapper(device_init), added = device_added }, - can_handle = is_multi_switch_no_master + can_handle = require("multi-switch-no-master.can_handle"), } return multi_switch_no_master - diff --git a/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/can_handle.lua new file mode 100644 index 0000000000..ce1a124104 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/can_handle.lua @@ -0,0 +1,8 @@ +return function(opts, driver, device) + local st_device = require "st.device" + + if device.network_type ~= st_device.NETWORK_TYPE_ZIGBEE and device.network_type ~= st_device.NETWORK_TYPE_CHILD then + return true, require("non_zigbee_devices") + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/init.lua b/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/init.lua index bc6caa8580..628eb825ff 100644 --- a/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/init.lua @@ -17,15 +17,8 @@ -- This patch works around it until hubcore 0.59 is released with -- https://smartthings.atlassian.net/browse/CHAD-16552 -local st_device = require "st.device" local log = require "log" -local function can_handle(opts, driver, device) - if device.network_type ~= st_device.NETWORK_TYPE_ZIGBEE and device.network_type ~= st_device.NETWORK_TYPE_CHILD then - return true, require("non_zigbee_devices") - end - return false -end local function device_added(driver, device, event) log.info(string.format("Non zigbee device added: %s", device)) @@ -51,7 +44,7 @@ local non_zigbee_devices = { doConfigure = do_configure, infoChanged = info_changed }, - can_handle = can_handle + can_handle = require("non_zigbee_devices.can_handle"), } -return non_zigbee_devices \ No newline at end of file +return non_zigbee_devices diff --git a/drivers/SmartThings/zigbee-switch/src/rexense/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/rexense/can_handle.lua new file mode 100644 index 0000000000..7fee03f115 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/rexense/can_handle.lua @@ -0,0 +1,13 @@ +return function(opts, driver, device) +local ZIGBEE_METERING_PLUG_FINGERPRINTS = { + { mfr = "REXENSE", model = "HY0105" } -- HONYAR Outlet" +} + for _, fingerprint in ipairs(ZIGBEE_METERING_PLUG_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("rexense") + return true, subdriver + end + end + + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/rexense/init.lua b/drivers/SmartThings/zigbee-switch/src/rexense/init.lua index d0d457928e..598afa75ec 100644 --- a/drivers/SmartThings/zigbee-switch/src/rexense/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/rexense/init.lua @@ -17,10 +17,6 @@ local capabilities = require "st.capabilities" local OnOff = zcl_clusters.OnOff -local ZIGBEE_METERING_PLUG_FINGERPRINTS = { - { mfr = "REXENSE", model = "HY0105" } -- HONYAR Outlet" -} - local function switch_on_handler(driver, device, command) device:send_to_component(command.component, OnOff.server.commands.On(device)) device:send(OnOff.server.commands.On(device):to_endpoint(0x02)) @@ -31,16 +27,6 @@ local function switch_off_handler(driver, device, command) device:send(OnOff.server.commands.Off(device):to_endpoint(0x02)) end -local function is_zigbee_metering_plug(opts, driver, device) - for _, fingerprint in ipairs(ZIGBEE_METERING_PLUG_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("rexense") - return true, subdriver - end - end - - return false -end local zigbee_metering_plug = { NAME = "zigbee metering plug", @@ -50,7 +36,7 @@ local zigbee_metering_plug = { [capabilities.switch.commands.off.NAME] = switch_off_handler } }, - can_handle = is_zigbee_metering_plug + can_handle = require("rexense.can_handle"), } return zigbee_metering_plug diff --git a/drivers/SmartThings/zigbee-switch/src/rgb-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/rgb-bulb/can_handle.lua new file mode 100644 index 0000000000..6d255174d6 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/rgb-bulb/can_handle.lua @@ -0,0 +1,20 @@ +return function(opts, driver, device) +local RGB_BULB_FINGERPRINTS = { + ["OSRAM"] = { + ["Gardenspot RGB"] = true, + ["LIGHTIFY Gardenspot RGB"] = true + }, + ["LEDVANCE"] = { + ["Outdoor Accent RGB"] = true + } +} + + + local can_handle = (RGB_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] + if can_handle then + local subdriver = require("rgb-bulb") + return true, subdriver + else + return false + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/rgb-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/rgb-bulb/init.lua index ce0f9976db..03ed2b1574 100644 --- a/drivers/SmartThings/zigbee-switch/src/rgb-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/rgb-bulb/init.lua @@ -19,25 +19,6 @@ local OnOff = clusters.OnOff local Level = clusters.Level local ColorControl = clusters.ColorControl -local RGB_BULB_FINGERPRINTS = { - ["OSRAM"] = { - ["Gardenspot RGB"] = true, - ["LIGHTIFY Gardenspot RGB"] = true - }, - ["LEDVANCE"] = { - ["Outdoor Accent RGB"] = true - } -} - -local function can_handle_rgb_bulb(opts, driver, device) - local can_handle = (RGB_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] - if can_handle then - local subdriver = require("rgb-bulb") - return true, subdriver - else - return false - end -end local function do_refresh(driver, device) local attributes = { @@ -66,7 +47,7 @@ local rgb_bulb = { lifecycle_handlers = { doConfigure = do_configure }, - can_handle = can_handle_rgb_bulb + can_handle = require("rgb-bulb.can_handle"), } return rgb_bulb diff --git a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/can_handle.lua new file mode 100644 index 0000000000..77c16d7b90 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/can_handle.lua @@ -0,0 +1,10 @@ +return function(opts, driver, device) + local RGBW_BULB_FINGERPRINTS = require "rgbw-bulb.fingerprints" + local can_handle = (RGBW_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] + if can_handle then + local subdriver = require("rgbw-bulb") + return true, subdriver + else + return false + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/fingerprints.lua new file mode 100644 index 0000000000..e0c8c3dd93 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/fingerprints.lua @@ -0,0 +1,71 @@ +return { + ["Samsung Electronics"] = { + ["SAMSUNG-ITM-Z-002"] = true + }, + ["Juno"] = { + ["ABL-LIGHT-Z-201"] = true + }, + ["AduroSmart Eria"] = { + ["AD-RGBW3001"] = true + }, + ["Aurora"] = { + ["RGBCXStrip50AU"] = true, + ["RGBGU10Bulb50AU"] = true, + ["RGBBulb51AU"] = true + }, + ["CWD"] = { + ["ZB.A806Ergbw-A001"] = true, + ["ZB.A806Brgbw-A001"] = true, + ["ZB.M350rgbw-A001"] = true + }, + ["innr"] = { + ["RB 285 C"] = true, + ["BY 285 C"] = true, + ["RB 250 C"] = true, + ["RS 230 C"] = true, + ["AE 280 C"] = true + }, + ["MLI"] = { + ["ZBT-ExtendedColor"] = true + }, + ["OSRAM"] = { + ["LIGHTIFY Flex RGBW"] = true, + ["Flex RGBW"] = true, + ["LIGHTIFY A19 RGBW"] = true, + ["LIGHTIFY BR RGBW"] = true, + ["LIGHTIFY RT RGBW"] = true, + ["LIGHTIFY FLEX OUTDOOR RGBW"] = true + }, + ["LEDVANCE"] = { + ["RT HO RGBW"] = true, + ["A19 RGBW"] = true, + ["FLEX Outdoor RGBW"] = true, + ["FLEX RGBW"] = true, + ["BR30 RGBW"] = true, + ["RT RGBW"] = true, + ["Outdoor Pathway RGBW"] = true, + ["Flex RGBW Pro"] = true + }, + ["LEEDARSON LIGHTING"] = { + ["5ZB-A806ST-Q1G"] = true + }, + ["sengled"] = { + ["E11-N1EA"] = true, + ["E12-N1E"] = true, + ["E21-N1EA"] = true, + ["E1G-G8E"] = true, + ["E11-U3E"] = true, + ["E11-U2E"] = true, + ["E1F-N5E"] = true, + ["E23-N13"] = true + }, + ["Neuhaus Lighting Group"] = { + ["ZBT-ExtendedColor"] = true + }, + ["Ajaxonline"] = { + ["AJ-RGBCCT 5 in 1"] = true + }, + ["Ajax online Ltd"] = { + ["AJ_ZB30_GU10"] = true + } +} diff --git a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/init.lua index fb3a1a32f2..aa9b25e9ae 100644 --- a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/init.lua @@ -20,88 +20,6 @@ local OnOff = clusters.OnOff local Level = clusters.Level local ColorControl = clusters.ColorControl -local RGBW_BULB_FINGERPRINTS = { - ["Samsung Electronics"] = { - ["SAMSUNG-ITM-Z-002"] = true - }, - ["Juno"] = { - ["ABL-LIGHT-Z-201"] = true - }, - ["AduroSmart Eria"] = { - ["AD-RGBW3001"] = true - }, - ["Aurora"] = { - ["RGBCXStrip50AU"] = true, - ["RGBGU10Bulb50AU"] = true, - ["RGBBulb51AU"] = true - }, - ["CWD"] = { - ["ZB.A806Ergbw-A001"] = true, - ["ZB.A806Brgbw-A001"] = true, - ["ZB.M350rgbw-A001"] = true - }, - ["innr"] = { - ["RB 285 C"] = true, - ["BY 285 C"] = true, - ["RB 250 C"] = true, - ["RS 230 C"] = true, - ["AE 280 C"] = true - }, - ["MLI"] = { - ["ZBT-ExtendedColor"] = true - }, - ["OSRAM"] = { - ["LIGHTIFY Flex RGBW"] = true, - ["Flex RGBW"] = true, - ["LIGHTIFY A19 RGBW"] = true, - ["LIGHTIFY BR RGBW"] = true, - ["LIGHTIFY RT RGBW"] = true, - ["LIGHTIFY FLEX OUTDOOR RGBW"] = true - }, - ["LEDVANCE"] = { - ["RT HO RGBW"] = true, - ["A19 RGBW"] = true, - ["FLEX Outdoor RGBW"] = true, - ["FLEX RGBW"] = true, - ["BR30 RGBW"] = true, - ["RT RGBW"] = true, - ["Outdoor Pathway RGBW"] = true, - ["Flex RGBW Pro"] = true - }, - ["LEEDARSON LIGHTING"] = { - ["5ZB-A806ST-Q1G"] = true - }, - ["sengled"] = { - ["E11-N1EA"] = true, - ["E12-N1E"] = true, - ["E21-N1EA"] = true, - ["E1G-G8E"] = true, - ["E11-U3E"] = true, - ["E11-U2E"] = true, - ["E1F-N5E"] = true, - ["E23-N13"] = true - }, - ["Neuhaus Lighting Group"] = { - ["ZBT-ExtendedColor"] = true - }, - ["Ajaxonline"] = { - ["AJ-RGBCCT 5 in 1"] = true - }, - ["Ajax online Ltd"] = { - ["AJ_ZB30_GU10"] = true - } -} - -local function can_handle_rgbw_bulb(opts, driver, device) - local can_handle = (RGBW_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] - if can_handle then - local subdriver = require("rgbw-bulb") - return true, subdriver - else - return false - end -end - local function do_refresh(driver, device) local attributes = { OnOff.attributes.OnOff, @@ -149,7 +67,7 @@ local rgbw_bulb = { doConfigure = do_configure, added = do_added }, - can_handle = can_handle_rgbw_bulb + can_handle = require("rgbw-bulb.can_handle"), } return rgbw_bulb diff --git a/drivers/SmartThings/zigbee-switch/src/robb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/robb/can_handle.lua new file mode 100644 index 0000000000..4544c17d64 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/robb/can_handle.lua @@ -0,0 +1,14 @@ +return function(opts, driver, device) +local ROBB_DIMMER_FINGERPRINTS = { + { mfr = "ROBB smarrt", model = "ROB_200-011-0" }, + { mfr = "ROBB smarrt", model = "ROB_200-014-0" } +} + for _, fingerprint in ipairs(ROBB_DIMMER_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("robb") + return true, subdriver + end + end + return false +end + diff --git a/drivers/SmartThings/zigbee-switch/src/robb/init.lua b/drivers/SmartThings/zigbee-switch/src/robb/init.lua index 4593b4339f..9081d058db 100644 --- a/drivers/SmartThings/zigbee-switch/src/robb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/robb/init.lua @@ -18,27 +18,12 @@ local capabilities = require "st.capabilities" local configurations = require "configurations" local SimpleMetering = zcl_clusters.SimpleMetering -local ROBB_DIMMER_FINGERPRINTS = { - { mfr = "ROBB smarrt", model = "ROB_200-011-0" }, - { mfr = "ROBB smarrt", model = "ROB_200-014-0" } -} - -local function is_robb_dimmer(opts, driver, device) - for _, fingerprint in ipairs(ROBB_DIMMER_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("robb") - return true, subdriver - end - end - return false -end local do_init = function(driver, device) device:set_field(constants.SIMPLE_METERING_DIVISOR_KEY, 1000000, {persist = true}) device:set_field(constants.ELECTRICAL_MEASUREMENT_DIVISOR_KEY, 10, {persist = true}) end - local function power_meter_handler(driver, device, value, zb_rx) local raw_value = value.value local multiplier = device:get_field(constants.ELECTRICAL_MEASUREMENT_MULTIPLIER_KEY) or 1 @@ -60,7 +45,7 @@ local robb_dimmer_handler = { lifecycle_handlers = { init = configurations.power_reconfig_wrapper(do_init) }, - can_handle = is_robb_dimmer + can_handle = require("robb.can_handle"), } return robb_dimmer_handler diff --git a/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/can_handle.lua new file mode 100644 index 0000000000..326de13801 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/can_handle.lua @@ -0,0 +1,9 @@ +return function(opts, driver, device, ...) + local can_handle = device:get_manufacturer() == "Sinope Technologies" and device:get_model() == "DM2500ZB" + if can_handle then + local subdriver = require("sinope-dimmer") + return true, subdriver + else + return false + end + end diff --git a/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/init.lua b/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/init.lua index 981df6ff5e..c2aba06bda 100644 --- a/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/init.lua @@ -104,15 +104,7 @@ local zigbee_sinope_dimmer = { lifecycle_handlers = { infoChanged = info_changed }, - can_handle = function(opts, driver, device, ...) - local can_handle = device:get_manufacturer() == "Sinope Technologies" and device:get_model() == "DM2500ZB" - if can_handle then - local subdriver = require("sinope-dimmer") - return true, subdriver - else - return false - end - end + can_handle = require("sinope-dimmer.can_handle"), } return zigbee_sinope_dimmer diff --git a/drivers/SmartThings/zigbee-switch/src/sinope/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/sinope/can_handle.lua new file mode 100644 index 0000000000..90b7965184 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/sinope/can_handle.lua @@ -0,0 +1,9 @@ +return function(opts, driver, device, ...) + local can_handle = device:get_manufacturer() == "Sinope Technologies" and device:get_model() == "SW2500ZB" + if can_handle then + local subdriver = require("sinope") + return true, subdriver + else + return false + end + end diff --git a/drivers/SmartThings/zigbee-switch/src/sinope/init.lua b/drivers/SmartThings/zigbee-switch/src/sinope/init.lua index d3e34513a5..a7101bb971 100644 --- a/drivers/SmartThings/zigbee-switch/src/sinope/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/sinope/init.lua @@ -41,15 +41,7 @@ local zigbee_sinope_switch = { lifecycle_handlers = { infoChanged = info_changed }, - can_handle = function(opts, driver, device, ...) - local can_handle = device:get_manufacturer() == "Sinope Technologies" and device:get_model() == "SW2500ZB" - if can_handle then - local subdriver = require("sinope") - return true, subdriver - else - return false - end - end + can_handle = require("sinope.can_handle"), } return zigbee_sinope_switch diff --git a/drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua new file mode 100644 index 0000000000..f471c99151 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua @@ -0,0 +1,18 @@ +local function is_multi_endpoint(device) + local main_endpoint = device:get_endpoint(0x0006) + for _, ep in ipairs(device.zigbee_endpoints) do + if ep.id ~= main_endpoint then + return true + end + end + return false +end + +return function(opts, driver, device) + local TUYA_MFR_HEADER = "_TZ" + if string.sub(device:get_manufacturer(),1,3) == TUYA_MFR_HEADER and is_multi_endpoint(device) then -- if it is a tuya device, then send the magic packet + local subdriver = require("tuya-multi") + return true, subdriver + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/tuya-multi/init.lua b/drivers/SmartThings/zigbee-switch/src/tuya-multi/init.lua index c4857e9085..b0c7b85202 100644 --- a/drivers/SmartThings/zigbee-switch/src/tuya-multi/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/tuya-multi/init.lua @@ -6,26 +6,6 @@ local messages = require "st.zigbee.messages" local zb_const = require "st.zigbee.constants" local read_attribute = require "st.zigbee.zcl.global_commands.read_attribute" -local TUYA_MFR_HEADER = "_TZ" - -local function is_multi_endpoint(device) - local main_endpoint = device:get_endpoint(clusters.OnOff.ID) - for _, ep in ipairs(device.zigbee_endpoints) do - if ep.id ~= main_endpoint then - return true - end - end - return false -end - -local function is_tuya_products(opts, driver, device) - if string.sub(device:get_manufacturer(),1,3) == TUYA_MFR_HEADER and is_multi_endpoint(device) then -- if it is a tuya device, then send the magic packet - local subdriver = require("tuya-multi") - return true, subdriver - end - return false -end - local function read_attribute_function(device, cluster_id, attr_id) local read_body = read_attribute.ReadAttribute( attr_id ) local zclh = zcl_messages.ZclHeader({ @@ -65,7 +45,7 @@ local tuya_switch_handler = { supported_capabilities = { capabilities.switch }, - can_handle = is_tuya_products + can_handle = require("tuya-multi.can_handle"), } -return tuya_switch_handler \ No newline at end of file +return tuya_switch_handler diff --git a/drivers/SmartThings/zigbee-switch/src/wallhero/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/wallhero/can_handle.lua new file mode 100644 index 0000000000..d63ed62a49 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/wallhero/can_handle.lua @@ -0,0 +1,11 @@ +return function(opts, driver, device, ...) + local FINGERPRINTS = require "wallhero.fingerprints" + for _, fingerprint in ipairs(FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("wallhero") + return true, subdriver + end + end + return false +end + diff --git a/drivers/SmartThings/zigbee-switch/src/wallhero/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/wallhero/fingerprints.lua new file mode 100644 index 0000000000..c352b6feb4 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/wallhero/fingerprints.lua @@ -0,0 +1,8 @@ +return { + { mfr = "WALL HERO", model = "ACL-401S4I", switches = 4, buttons = 0 }, + { mfr = "WALL HERO", model = "ACL-401S8I", switches = 4, buttons = 4 }, + { mfr = "WALL HERO", model = "ACL-401S3I", switches = 3, buttons = 0 }, + { mfr = "WALL HERO", model = "ACL-401S2I", switches = 2, buttons = 0 }, + { mfr = "WALL HERO", model = "ACL-401S1I", switches = 1, buttons = 0 }, + { mfr = "WALL HERO", model = "ACL-401ON", switches = 1, buttons = 0 } +} diff --git a/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua b/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua index 79f3110e41..531a7c4bf2 100644 --- a/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua @@ -25,26 +25,8 @@ local PRIVATE_CLUSTER_ID = 0x0006 local PRIVATE_ATTRIBUTE_ID = 0x6000 local MFG_CODE = 0x1235 -local FINGERPRINTS = { - { mfr = "WALL HERO", model = "ACL-401S4I", switches = 4, buttons = 0 }, - { mfr = "WALL HERO", model = "ACL-401S8I", switches = 4, buttons = 4 }, - { mfr = "WALL HERO", model = "ACL-401S3I", switches = 3, buttons = 0 }, - { mfr = "WALL HERO", model = "ACL-401S2I", switches = 2, buttons = 0 }, - { mfr = "WALL HERO", model = "ACL-401S1I", switches = 1, buttons = 0 }, - { mfr = "WALL HERO", model = "ACL-401ON", switches = 1, buttons = 0 } -} - -local function can_handle_wallhero_switch(opts, driver, device, ...) - for _, fingerprint in ipairs(FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("wallhero") - return true, subdriver - end - end - return false -end - local function get_children_info(device) + local FINGERPRINTS = require "wallhero.fingerprints" for _, fingerprint in ipairs(FINGERPRINTS) do if device:get_model() == fingerprint.model then return fingerprint.switches, fingerprint.buttons @@ -141,7 +123,7 @@ local wallheroswitch = { } } }, - can_handle = can_handle_wallhero_switch + can_handle = require("wallhero.can_handle"), } return wallheroswitch diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/can_handle.lua new file mode 100644 index 0000000000..1b609d16ad --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/can_handle.lua @@ -0,0 +1,10 @@ +return function(opts, driver, device) + local WHITE_COLOR_TEMP_BULB_FINGERPRINTS = require "white-color-temp-bulb.fingerprints" + local can_handle = (WHITE_COLOR_TEMP_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] + if can_handle then + local subdriver = require("white-color-temp-bulb") + return true, subdriver + else + return false + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/can_handle.lua new file mode 100644 index 0000000000..2b4c439e64 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/can_handle.lua @@ -0,0 +1,15 @@ +return function(opts, driver, device) + local DURAGREEN_BULB_FINGERPRINTS = { + ["DURAGREEN"] = { + ["DG-CW-02"] = true, + ["DG-CW-01"] = true, + ["DG-CCT-01"] = true + }, + } + local res = (DURAGREEN_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] or false + if res then + return res, require("white-color-temp-bulb.duragreen") + else + return res + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/init.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/init.lua index 7df79be32e..4c6d134e0e 100644 --- a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/init.lua @@ -17,18 +17,6 @@ local clusters = require "st.zigbee.zcl.clusters" local Level = clusters.Level -local DURAGREEN_BULB_FINGERPRINTS = { - ["DURAGREEN"] = { - ["DG-CW-02"] = true, - ["DG-CW-01"] = true, - ["DG-CCT-01"] = true - }, -} - -local function can_handle_duragreen_bulb(opts, driver, device) - return (DURAGREEN_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] or false -end - local function handle_set_level(driver, device, cmd) local level = math.floor(cmd.args.level/100.0 * 254) local transtition_time = cmd.args.rate or 0xFFFF @@ -46,7 +34,7 @@ local duragreen_color_temp_bulb = { [capabilities.switchLevel.commands.setLevel.NAME] = handle_set_level } }, - can_handle = can_handle_duragreen_bulb + can_handle = require("white-color-temp-bulb.duragreen.can_handle") } return duragreen_color_temp_bulb diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/fingerprints.lua new file mode 100644 index 0000000000..6824bf40ae --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/fingerprints.lua @@ -0,0 +1,96 @@ +return { + ["DURAGREEN"] = { + ["DG-CW-02"] = true, + ["DG-CW-01"] = true, + ["DG-CCT-01"] = true + }, + ["Samsung Electronics"] = { + ["ABL-LIGHT-Z-001"] = true, + ["SAMSUNG-ITM-Z-001"] = true + }, + ["Juno"] = { + ["ABL-LIGHT-Z-001"] = true + }, + ["AduroSmart Eria"] = { + ["AD-ColorTemperature3001"] = true + }, + ["Aurora"] = { + ["TWBulb51AU"] = true, + ["TWMPROZXBulb50AU"] = true, + ["TWStrip50AU"] = true, + ["TWGU10Bulb50AU"] = true, + ["TWCLBulb50AU"] = true + }, + ["CWD"] = { + ["ZB.A806Ecct-A001"] = true, + ["ZB.A806Bcct-A001"] = true, + ["ZB.M350cct-A001"] = true + }, + ["ETI"] = { + ["Zigbee CCT Downlight"] = true + }, + ["The Home Depot"] = { + ["Ecosmart-ZBT-BR30-CCT-Bulb"] = true, + ["Ecosmart-ZBT-A19-CCT-Bulb"] = true + }, + ["IKEA of Sweden"] = { + ["GUNNARP panel round"] = true, + ["LEPTITER Recessed spot light"] = true, + ["TRADFRI bulb E12 WS opal 600lm"] = true, + ["TRADFRI bulb E14 WS 470lm"] = true, + ["TRADFRI bulb E14 WS opal 600lm"] = true, + ["TRADFRI bulb E26 WS clear 806lm"] = true, + ["TRADFRI bulb E27 WS clear 806lm"] = true, + ["TRADFRI bulb E26 WS opal 1000lm"] = true, + ["TRADFRI bulb E27 WS opal 1000lm"] = true + }, + ["Megaman"] = { + ["Z3-ColorTemperature"] = true + }, + ["innr"] = { + ["RB 248 T"] = true, + ["RB 278 T"] = true, + ["RS 228 T"] = true + }, + ["OSRAM"] = { + ["LIGHTIFY BR Tunable White"] = true, + ["LIGHTIFY RT Tunable White"] = true, + ["Classic A60 TW"] = true, + ["LIGHTIFY A19 Tunable White"] = true, + ["Classic B40 TW - LIGHTIFY"] = true, + ["LIGHTIFY Conv Under Cabinet TW"] = true, + ["ColorstripRGBW"] = true, + ["LIGHTIFY Edge-lit Flushmount TW"] = true, + ["LIGHTIFY Surface TW"] = true, + ["LIGHTIFY Under Cabinet TW"] = true, + ["LIGHTIFY Edge-lit flushmount"] = true + }, + ["LEDVANCE"] = { + ["A19 TW 10 year"] = true, + ["MR16 TW"] = true, + ["BR30 TW"] = true, + ["RT TW"] = true + }, + ["Smarthome"] = { + ["S111-202A"] = true + }, + ["lk"] = { + ["ZBT-CCTLight-GLS0108"] = true + }, + ["MLI"] = { + ["ZBT-ColorTemperature"] = true + }, + ["sengled"] = { + ["Z01-A19NAE26"] = true, + ["Z01-A191AE26W"] = true, + ["Z01-A60EAB22"] = true, + ["Z01-A60EAE27"] = true + }, + ["Third Reality, Inc"] = { + ["3RSL011Z"] = true, + ["3RSL012Z"] = true + }, + ["Ajax Online"] = { + ["CCT"] = true + } +} diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/init.lua index 70efb29afa..40b482604c 100644 --- a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/init.lua @@ -18,113 +18,6 @@ local colorTemperature_defaults = require "st.zigbee.defaults.colorTemperature_d local ColorControl = clusters.ColorControl -local WHITE_COLOR_TEMP_BULB_FINGERPRINTS = { - ["DURAGREEN"] = { - ["DG-CW-02"] = true, - ["DG-CW-01"] = true, - ["DG-CCT-01"] = true - }, - ["Samsung Electronics"] = { - ["ABL-LIGHT-Z-001"] = true, - ["SAMSUNG-ITM-Z-001"] = true - }, - ["Juno"] = { - ["ABL-LIGHT-Z-001"] = true - }, - ["AduroSmart Eria"] = { - ["AD-ColorTemperature3001"] = true - }, - ["Aurora"] = { - ["TWBulb51AU"] = true, - ["TWMPROZXBulb50AU"] = true, - ["TWStrip50AU"] = true, - ["TWGU10Bulb50AU"] = true, - ["TWCLBulb50AU"] = true - }, - ["CWD"] = { - ["ZB.A806Ecct-A001"] = true, - ["ZB.A806Bcct-A001"] = true, - ["ZB.M350cct-A001"] = true - }, - ["ETI"] = { - ["Zigbee CCT Downlight"] = true - }, - ["The Home Depot"] = { - ["Ecosmart-ZBT-BR30-CCT-Bulb"] = true, - ["Ecosmart-ZBT-A19-CCT-Bulb"] = true - }, - ["IKEA of Sweden"] = { - ["GUNNARP panel round"] = true, - ["LEPTITER Recessed spot light"] = true, - ["TRADFRI bulb E12 WS opal 600lm"] = true, - ["TRADFRI bulb E14 WS 470lm"] = true, - ["TRADFRI bulb E14 WS opal 600lm"] = true, - ["TRADFRI bulb E26 WS clear 806lm"] = true, - ["TRADFRI bulb E27 WS clear 806lm"] = true, - ["TRADFRI bulb E26 WS opal 1000lm"] = true, - ["TRADFRI bulb E27 WS opal 1000lm"] = true - }, - ["Megaman"] = { - ["Z3-ColorTemperature"] = true - }, - ["innr"] = { - ["RB 248 T"] = true, - ["RB 278 T"] = true, - ["RS 228 T"] = true - }, - ["OSRAM"] = { - ["LIGHTIFY BR Tunable White"] = true, - ["LIGHTIFY RT Tunable White"] = true, - ["Classic A60 TW"] = true, - ["LIGHTIFY A19 Tunable White"] = true, - ["Classic B40 TW - LIGHTIFY"] = true, - ["LIGHTIFY Conv Under Cabinet TW"] = true, - ["ColorstripRGBW"] = true, - ["LIGHTIFY Edge-lit Flushmount TW"] = true, - ["LIGHTIFY Surface TW"] = true, - ["LIGHTIFY Under Cabinet TW"] = true, - ["LIGHTIFY Edge-lit flushmount"] = true - }, - ["LEDVANCE"] = { - ["A19 TW 10 year"] = true, - ["MR16 TW"] = true, - ["BR30 TW"] = true, - ["RT TW"] = true - }, - ["Smarthome"] = { - ["S111-202A"] = true - }, - ["lk"] = { - ["ZBT-CCTLight-GLS0108"] = true - }, - ["MLI"] = { - ["ZBT-ColorTemperature"] = true - }, - ["sengled"] = { - ["Z01-A19NAE26"] = true, - ["Z01-A191AE26W"] = true, - ["Z01-A60EAB22"] = true, - ["Z01-A60EAE27"] = true - }, - ["Third Reality, Inc"] = { - ["3RSL011Z"] = true, - ["3RSL012Z"] = true - }, - ["Ajax Online"] = { - ["CCT"] = true - } -} - -local function can_handle_white_color_temp_bulb(opts, driver, device) - local can_handle = (WHITE_COLOR_TEMP_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] - if can_handle then - local subdriver = require("white-color-temp-bulb") - return true, subdriver - else - return false - end -end - local function set_color_temperature_handler(driver, device, cmd) colorTemperature_defaults.set_color_temperature(driver, device, cmd) @@ -140,10 +33,8 @@ local white_color_temp_bulb = { [capabilities.colorTemperature.commands.setColorTemperature.NAME] = set_color_temperature_handler } }, - sub_drivers = { - require("white-color-temp-bulb.duragreen"), - }, - can_handle = can_handle_white_color_temp_bulb + sub_drivers = require("white-color-temp-bulb.sub_drivers"), + can_handle = require("white-color-temp-bulb.can_handle"), } return white_color_temp_bulb diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/sub_drivers.lua new file mode 100644 index 0000000000..450c97b97b --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/sub_drivers.lua @@ -0,0 +1,4 @@ +local lazy_load = require "lazy_load_subdriver" +return { + lazy_load("white-color-temp-bulb.duragreen"), +} diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/can_handle.lua new file mode 100644 index 0000000000..7776397269 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/can_handle.lua @@ -0,0 +1,13 @@ +local ZIGBEE_DIMMER_POWER_ENERGY_FINGERPRINTS = { + { mfr = "Jasco Products", model = "43082" } +} + +return function(opts, driver, device) + for _, fingerprint in ipairs(ZIGBEE_DIMMER_POWER_ENERGY_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("zigbee-dimmer-power-energy") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/init.lua index 75f2af82c1..b3c1a61969 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/init.lua @@ -18,20 +18,6 @@ local SimpleMetering = clusters.SimpleMetering local constants = require "st.zigbee.constants" local configurations = require "configurations" -local ZIGBEE_DIMMER_POWER_ENERGY_FINGERPRINTS = { - { mfr = "Jasco Products", model = "43082" } -} - -local is_zigbee_dimmer_power_energy = function(opts, driver, device) - for _, fingerprint in ipairs(ZIGBEE_DIMMER_POWER_ENERGY_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("zigbee-dimmer-power-energy") - return true, subdriver - end - end - return false -end - local device_init = function(self, device) local customEnergyDivisor = 10000 device:set_field(constants.SIMPLE_METERING_DIVISOR_KEY, customEnergyDivisor, {persist = true}) @@ -69,7 +55,7 @@ local zigbee_dimmer_power_energy_handler = { init = configurations.power_reconfig_wrapper(device_init), doConfigure = do_configure, }, - can_handle = is_zigbee_dimmer_power_energy + can_handle = require("zigbee-dimmer-power-energy.can_handle"), } return zigbee_dimmer_power_energy_handler diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/can_handle.lua new file mode 100644 index 0000000000..1c2f6d3f69 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/can_handle.lua @@ -0,0 +1,10 @@ +return function(opts, driver, device) + local DIMMING_LIGHT_FINGERPRINTS = require "zigbee-dimming-light.fingerprints" + for _, fingerprint in ipairs(DIMMING_LIGHT_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("zigbee-dimming-light") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/fingerprints.lua new file mode 100644 index 0000000000..b90edb17e8 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/fingerprints.lua @@ -0,0 +1,33 @@ +return { + {mfr = "Vimar", model = "DimmerSwitch_v1.0"}, -- Vimar Smart Dimmer Switch + {mfr = "OSRAM", model = "LIGHTIFY A19 ON/OFF/DIM"}, -- SYLVANIA Smart A19 Soft White + {mfr = "OSRAM", model = "LIGHTIFY A19 ON/OFF/DIM 10 Year"}, -- SYLVANIA Smart 10-Year A19 + {mfr = "OSRAM SYLVANIA", model = "iQBR30"}, -- SYLVANIA Ultra iQ + {mfr = "OSRAM", model = "LIGHTIFY PAR38 ON/OFF/DIM"}, -- SYLVANIA Smart PAR38 Soft White + {mfr = "OSRAM", model = "LIGHTIFY BR ON/OFF/DIM"}, -- SYLVANIA Smart BR30 Soft White + {mfr = "sengled", model = "E11-G13"}, -- Sengled Element Classic + {mfr = "sengled", model = "E11-G14"}, -- Sengled Element Classic + {mfr = "sengled", model = "E11-G23"}, -- Sengled Element Classic + {mfr = "sengled", model = "E11-G33"}, -- Sengled Element Classic + {mfr = "sengled", model = "E12-N13"}, -- Sengled Element Classic + {mfr = "sengled", model = "E12-N14"}, -- Sengled Element Classic + {mfr = "sengled", model = "E12-N15"}, -- Sengled Element Classic + {mfr = "sengled", model = "E11-N13"}, -- Sengled Element Classic + {mfr = "sengled", model = "E11-N14"}, -- Sengled Element Classic + {mfr = "sengled", model = "E1A-AC2"}, -- Sengled DownLight + {mfr = "sengled", model = "E11-N13A"}, -- Sengled Extra Bright Soft White + {mfr = "sengled", model = "E11-N14A"}, -- Sengled Extra Bright Daylight + {mfr = "sengled", model = "E21-N13A"}, -- Sengled Soft White + {mfr = "sengled", model = "E21-N14A"}, -- Sengled Daylight + {mfr = "sengled", model = "E11-U21U31"}, -- Sengled Element Touch + {mfr = "sengled", model = "E13-A21"}, -- Sengled LED Flood Light + {mfr = "sengled", model = "E11-N1G"}, -- Sengled Smart LED Vintage Edison Bulb + {mfr = "sengled", model = "E23-N11"}, -- Sengled Element Classic par38 + {mfr = "Leviton", model = "DL6HD"}, -- Leviton Dimmer Switch + {mfr = "Leviton", model = "DL3HL"}, -- Leviton Lumina RF Plug-In Dimmer + {mfr = "Leviton", model = "DL1KD"}, -- Leviton Lumina RF Dimmer Switch + {mfr = "Leviton", model = "ZSD07"}, -- Leviton Lumina RF 0-10V Dimming Wall Switch + {mfr = "MRVL", model = "MZ100"}, + {mfr = "CREE", model = "Connected A-19 60W Equivalent"}, + {mfr = "Insta GmbH", model = "NEXENTRO Dimming Actuator"} +} diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/init.lua index 68e924a8f1..9b05f3092f 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/init.lua @@ -20,40 +20,6 @@ local switch_utils = require "switch_utils" local OnOff = clusters.OnOff local Level = clusters.Level -local DIMMING_LIGHT_FINGERPRINTS = { - {mfr = "Vimar", model = "DimmerSwitch_v1.0"}, -- Vimar Smart Dimmer Switch - {mfr = "OSRAM", model = "LIGHTIFY A19 ON/OFF/DIM"}, -- SYLVANIA Smart A19 Soft White - {mfr = "OSRAM", model = "LIGHTIFY A19 ON/OFF/DIM 10 Year"}, -- SYLVANIA Smart 10-Year A19 - {mfr = "OSRAM SYLVANIA", model = "iQBR30"}, -- SYLVANIA Ultra iQ - {mfr = "OSRAM", model = "LIGHTIFY PAR38 ON/OFF/DIM"}, -- SYLVANIA Smart PAR38 Soft White - {mfr = "OSRAM", model = "LIGHTIFY BR ON/OFF/DIM"}, -- SYLVANIA Smart BR30 Soft White - {mfr = "sengled", model = "E11-G13"}, -- Sengled Element Classic - {mfr = "sengled", model = "E11-G14"}, -- Sengled Element Classic - {mfr = "sengled", model = "E11-G23"}, -- Sengled Element Classic - {mfr = "sengled", model = "E11-G33"}, -- Sengled Element Classic - {mfr = "sengled", model = "E12-N13"}, -- Sengled Element Classic - {mfr = "sengled", model = "E12-N14"}, -- Sengled Element Classic - {mfr = "sengled", model = "E12-N15"}, -- Sengled Element Classic - {mfr = "sengled", model = "E11-N13"}, -- Sengled Element Classic - {mfr = "sengled", model = "E11-N14"}, -- Sengled Element Classic - {mfr = "sengled", model = "E1A-AC2"}, -- Sengled DownLight - {mfr = "sengled", model = "E11-N13A"}, -- Sengled Extra Bright Soft White - {mfr = "sengled", model = "E11-N14A"}, -- Sengled Extra Bright Daylight - {mfr = "sengled", model = "E21-N13A"}, -- Sengled Soft White - {mfr = "sengled", model = "E21-N14A"}, -- Sengled Daylight - {mfr = "sengled", model = "E11-U21U31"}, -- Sengled Element Touch - {mfr = "sengled", model = "E13-A21"}, -- Sengled LED Flood Light - {mfr = "sengled", model = "E11-N1G"}, -- Sengled Smart LED Vintage Edison Bulb - {mfr = "sengled", model = "E23-N11"}, -- Sengled Element Classic par38 - {mfr = "Leviton", model = "DL6HD"}, -- Leviton Dimmer Switch - {mfr = "Leviton", model = "DL3HL"}, -- Leviton Lumina RF Plug-In Dimmer - {mfr = "Leviton", model = "DL1KD"}, -- Leviton Lumina RF Dimmer Switch - {mfr = "Leviton", model = "ZSD07"}, -- Leviton Lumina RF 0-10V Dimming Wall Switch - {mfr = "MRVL", model = "MZ100"}, - {mfr = "CREE", model = "Connected A-19 60W Equivalent"}, - {mfr = "Insta GmbH", model = "NEXENTRO Dimming Actuator"} -} - local DIMMING_LIGHT_CONFIGURATION = { { cluster = OnOff.ID, @@ -75,16 +41,6 @@ local DIMMING_LIGHT_CONFIGURATION = { } } -local function can_handle_zigbee_dimming_light(opts, driver, device) - for _, fingerprint in ipairs(DIMMING_LIGHT_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("zigbee-dimming-light") - return true, subdriver - end - end - return false -end - local function do_configure(driver, device) device:refresh() device:configure() @@ -107,11 +63,8 @@ local zigbee_dimming_light = { added = device_added, doConfigure = do_configure }, - sub_drivers = { - require("zigbee-dimming-light/osram-iqbr30"), - require("zigbee-dimming-light/zll-dimmer") - }, - can_handle = can_handle_zigbee_dimming_light + sub_drivers = require("zigbee-dimming-light.sub_drivers"), + can_handle = require("zigbee-dimming-light.can_handle"), } return zigbee_dimming_light diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/can_handle.lua new file mode 100644 index 0000000000..a5cf2faff0 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/can_handle.lua @@ -0,0 +1,7 @@ +return function(opts, driver, device, ...) + local res = device:get_manufacturer() == "OSRAM SYLVANIA" and device:get_model() == "iQBR30" + if res then + return res, require("zigbee-dimming-light.osram-iqbr30") + end + return res +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/init.lua index c6d31b7e10..43d22558b8 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/init.lua @@ -20,10 +20,6 @@ local Level = clusters.Level local SwitchLevel = capabilities.switchLevel -local function can_handle_osram_iqbr30(opts, driver, device, ...) - return device:get_manufacturer() == "OSRAM SYLVANIA" and device:get_model() == "iQBR30" -end - local function set_switch_level_handler(driver, device, cmd) local level = math.floor(cmd.args.level / 100.0 * 254) @@ -40,7 +36,7 @@ local osram_iqbr30 = { [SwitchLevel.commands.setLevel.NAME] = set_switch_level_handler } }, - can_handle = can_handle_osram_iqbr30 + can_handle = require("zigbee-dimming-light.osram-iqbr30.can_handle"), } return osram_iqbr30 diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/sub_drivers.lua new file mode 100644 index 0000000000..6251d62343 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/sub_drivers.lua @@ -0,0 +1,6 @@ +local lazy_load = require "lazy_load_subdriver" + +return { + lazy_load("zigbee-dimming-light.osram-iqbr30"), + lazy_load("zigbee-dimming-light.zll-dimmer") +} diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/can_handle.lua new file mode 100644 index 0000000000..cba10b4d8a --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/can_handle.lua @@ -0,0 +1,9 @@ +return function(opts, driver, device) + local ZLL_DIMMER_FINGERPRINTS = require("zigbee-dimming-light.zll-dimmer.fingerprints") + for _, fingerprint in ipairs(ZLL_DIMMER_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + return true, require("zigbee-dimming-light.zll-dimmer") + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/fingerprints.lua new file mode 100644 index 0000000000..c41f026088 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/fingerprints.lua @@ -0,0 +1,8 @@ +return { + {mfr = "Leviton", model = "DL6HD"}, -- Leviton Dimmer Switch + {mfr = "Leviton", model = "DL3HL"}, -- Leviton Lumina RF Plug-In Dimmer + {mfr = "Leviton", model = "DL1KD"}, -- Leviton Lumina RF Dimmer Switch + {mfr = "Leviton", model = "ZSD07"}, -- Leviton Lumina RF 0-10V Dimming Wall Switch + {mfr = "MRVL", model = "MZ100"}, + {mfr = "CREE", model = "Connected A-19 60W Equivalent"} +} diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/init.lua index 72b35fd580..e42846b6a9 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/init.lua @@ -19,24 +19,6 @@ local Level = clusters.Level local SwitchLevel = capabilities.switchLevel -local ZLL_DIMMER_FINGERPRINTS = { - {mfr = "Leviton", model = "DL6HD"}, -- Leviton Dimmer Switch - {mfr = "Leviton", model = "DL3HL"}, -- Leviton Lumina RF Plug-In Dimmer - {mfr = "Leviton", model = "DL1KD"}, -- Leviton Lumina RF Dimmer Switch - {mfr = "Leviton", model = "ZSD07"}, -- Leviton Lumina RF 0-10V Dimming Wall Switch - {mfr = "MRVL", model = "MZ100"}, - {mfr = "CREE", model = "Connected A-19 60W Equivalent"} -} - -local function can_handle_zll_dimmer(opts, driver, device) - for _, fingerprint in ipairs(ZLL_DIMMER_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - return true - end - end - return false -end - local function set_switch_level_handler(driver, device, cmd) local level = math.floor(cmd.args.level / 100.0 * 254) @@ -51,7 +33,7 @@ local zll_dimmer = { [SwitchLevel.commands.setLevel.NAME] = set_switch_level_handler } }, - can_handle = can_handle_zll_dimmer + can_handle = require("zigbee-dimming-light.zll-dimmer.can_handle") } return zll_dimmer diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/can_handle.lua new file mode 100644 index 0000000000..37c655bee3 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/can_handle.lua @@ -0,0 +1,13 @@ +local ZIGBEE_DUAL_METERING_SWITCH_FINGERPRINT = { + {mfr = "Aurora", model = "DoubleSocket50AU"} +} + +return function(opts, driver, device, ...) + for _, fingerprint in ipairs(ZIGBEE_DUAL_METERING_SWITCH_FINGERPRINT) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("zigbee-dual-metering-switch") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/init.lua index 68f7d63675..981a4b5400 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/init.lua @@ -21,20 +21,6 @@ local configurations = require "configurations" local CHILD_ENDPOINT = 2 -local ZIGBEE_DUAL_METERING_SWITCH_FINGERPRINT = { - {mfr = "Aurora", model = "DoubleSocket50AU"} -} - -local function can_handle_zigbee_dual_metering_switch(opts, driver, device, ...) - for _, fingerprint in ipairs(ZIGBEE_DUAL_METERING_SWITCH_FINGERPRINT) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("zigbee-dual-metering-switch") - return true, subdriver - end - end - return false -end - local function do_refresh(self, device) device:send(OnOff.attributes.OnOff:read(device)) device:send(ElectricalMeasurement.attributes.ActivePower:read(device)) @@ -80,7 +66,7 @@ local zigbee_dual_metering_switch = { init = configurations.power_reconfig_wrapper(device_init), added = device_added }, - can_handle = can_handle_zigbee_dual_metering_switch + can_handle = require("zigbee-dual-metering-switch.can_handle"), } return zigbee_dual_metering_switch diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/can_handle.lua new file mode 100644 index 0000000000..56106764b6 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/can_handle.lua @@ -0,0 +1,9 @@ +return function(opts, driver, device, ...) + local can_handle = device:get_manufacturer() == "DAWON_DNS" + if can_handle then + local subdriver = require("zigbee-metering-plug-power-consumption-report") + return true, subdriver + else + return false + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua index 044bf509df..7da5a400c7 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua @@ -54,15 +54,7 @@ local zigbee_metering_plug_power_conumption_report = { init = configurations.power_reconfig_wrapper(device_init), doConfigure = do_configure }, - can_handle = function(opts, driver, device, ...) - local can_handle = device:get_manufacturer() == "DAWON_DNS" - if can_handle then - local subdriver = require("zigbee-metering-plug-power-consumption-report") - return true, subdriver - else - return false - end - end + can_handle = require("zigbee-metering-plug-power-consumption-report.can_handle"), } return zigbee_metering_plug_power_conumption_report diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/can_handle.lua new file mode 100644 index 0000000000..ee01893636 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/can_handle.lua @@ -0,0 +1,14 @@ + +return function(opts, driver, device) + local AURORA_RELAY_FINGERPRINTS = { + { mfr = "Aurora", model = "Smart16ARelay51AU" }, + { mfr = "Develco Products A/S", model = "Smart16ARelay51AU" }, + { mfr = "SALUS", model = "SX885ZB" } + } + for _, fingerprint in ipairs(AURORA_RELAY_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + return true, require("zigbee-switch-power.aurora-relay") + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua index 0f8eac96bc..42fa53e407 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua @@ -14,21 +14,6 @@ local constants = require "st.zigbee.constants" -local AURORA_RELAY_FINGERPRINTS = { - { mfr = "Aurora", model = "Smart16ARelay51AU" }, - { mfr = "Develco Products A/S", model = "Smart16ARelay51AU" }, - { mfr = "SALUS", model = "SX885ZB" } -} - -local function can_handle_aurora_relay(opts, driver, device) - for _, fingerprint in ipairs(AURORA_RELAY_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - return true - end - end - return false -end - local function do_configure(driver, device) device:configure() @@ -43,7 +28,7 @@ local aurora_relay = { lifecycle_handlers = { doConfigure = do_configure }, - can_handle = can_handle_aurora_relay + can_handle = require("zigbee-switch-power.aurora-relay.can_handle"), } return aurora_relay diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/can_handle.lua new file mode 100644 index 0000000000..788e0362ec --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/can_handle.lua @@ -0,0 +1,10 @@ +return function(opts, driver, device) + local SWITCH_POWER_FINGERPRINTS = require "zigbee-switch-power.fingerprints" + for _, fingerprint in ipairs(SWITCH_POWER_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + local subdriver = require("zigbee-switch-power") + return true, subdriver + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/fingerprints.lua new file mode 100644 index 0000000000..902b7e4937 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/fingerprints.lua @@ -0,0 +1,15 @@ +return { + { mfr = "Vimar", model = "Mains_Power_Outlet_v1.0" }, + { model = "PAN18-v1.0.7" }, + { model = "E210-KR210Z1-HA" }, + { mfr = "Aurora", model = "Smart16ARelay51AU" }, + { mfr = "Develco Products A/S", model = "Smart16ARelay51AU" }, + { mfr = "Jasco Products", model = "45853" }, + { mfr = "Jasco Products", model = "45856" }, + { mfr = "MEGAMAN", model = "SH-PSUKC44B-E" }, + { mfr = "ClimaxTechnology", model = "PSM_00.00.00.35TC" }, + { mfr = "SALUS", model = "SX885ZB" }, + { mfr = "AduroSmart Eria", model = "AD-SmartPlug3001" }, + { mfr = "AduroSmart Eria", model = "BPU3" }, + { mfr = "AduroSmart Eria", model = "BDP3001" } +} diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/init.lua index d9ae8f4750..9a32274d0a 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/init.lua @@ -19,32 +19,6 @@ local constants = require "st.zigbee.constants" local SimpleMetering = clusters.SimpleMetering local ElectricalMeasurement = clusters.ElectricalMeasurement -local SWITCH_POWER_FINGERPRINTS = { - { mfr = "Vimar", model = "Mains_Power_Outlet_v1.0" }, - { model = "PAN18-v1.0.7" }, - { model = "E210-KR210Z1-HA" }, - { mfr = "Aurora", model = "Smart16ARelay51AU" }, - { mfr = "Develco Products A/S", model = "Smart16ARelay51AU" }, - { mfr = "Jasco Products", model = "45853" }, - { mfr = "Jasco Products", model = "45856" }, - { mfr = "MEGAMAN", model = "SH-PSUKC44B-E" }, - { mfr = "ClimaxTechnology", model = "PSM_00.00.00.35TC" }, - { mfr = "SALUS", model = "SX885ZB" }, - { mfr = "AduroSmart Eria", model = "AD-SmartPlug3001" }, - { mfr = "AduroSmart Eria", model = "BPU3" }, - { mfr = "AduroSmart Eria", model = "BDP3001" } -} - -local function can_handle_zigbee_switch_power(opts, driver, device) - for _, fingerprint in ipairs(SWITCH_POWER_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - local subdriver = require("zigbee-switch-power") - return true, subdriver - end - end - return false -end - local function active_power_meter_handler(driver, device, value, zb_rx) local raw_value = value.value local divisor = device:get_field(constants.ELECTRICAL_MEASUREMENT_DIVISOR_KEY) or 10 @@ -75,11 +49,8 @@ local zigbee_switch_power = { } } }, - sub_drivers = { - require("zigbee-switch-power/aurora-relay"), - require("zigbee-switch-power/vimar") - }, - can_handle = can_handle_zigbee_switch_power + sub_drivers = require("zigbee-switch-power.sub_drivers"), + can_handle = require("zigbee-switch-power.can_handle"), } return zigbee_switch_power diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/sub_drivers.lua new file mode 100644 index 0000000000..b9c6316ba8 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/sub_drivers.lua @@ -0,0 +1,6 @@ +local lazy_load = require "lazy_load_subdriver" + +return { + lazy_load("zigbee-switch-power.aurora-relay"), + lazy_load("zigbee-switch-power.vimar") +} diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/can_handle.lua new file mode 100644 index 0000000000..8580ce38a8 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/can_handle.lua @@ -0,0 +1,12 @@ + +return function(opts, driver, device) + local VIMAR_FINGERPRINTS = { + { mfr = "Vimar", model = "Mains_Power_Outlet_v1.0" } + } + for _, fingerprint in ipairs(VIMAR_FINGERPRINTS) do + if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then + return true, require("zigbee-switch-power.vimar") + end + end + return false +end diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua index ed65ce785b..3a4c73d94a 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua @@ -18,19 +18,6 @@ local zcl_clusters = require "st.zigbee.zcl.clusters" local ElectricalMeasurement = zcl_clusters.ElectricalMeasurement -local VIMAR_FINGERPRINTS = { - { mfr = "Vimar", model = "Mains_Power_Outlet_v1.0" } -} - -local function can_handle_vimar_switch_power(opts, driver, device) - for _, fingerprint in ipairs(VIMAR_FINGERPRINTS) do - if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then - return true - end - end - return false -end - local function do_configure(driver, device) device:configure() device:set_field(constants.SIMPLE_METERING_DIVISOR_KEY, 1, {persist = true}) @@ -45,7 +32,7 @@ local vimar_switch_power = { lifecycle_handlers = { doConfigure = do_configure }, - can_handle = can_handle_vimar_switch_power + can_handle = require("zigbee-switch-power.vimar.can_handle"), } return vimar_switch_power diff --git a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/can_handle.lua new file mode 100644 index 0000000000..354cd3bf9f --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/can_handle.lua @@ -0,0 +1,10 @@ +return function(opts, driver, device) + local ZLL_DIMMER_BULB_FINGERPRINTS = require "zll-dimmer-bulb.fingerprints" + local can_handle = (ZLL_DIMMER_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] + if can_handle then + local subdriver = require("zll-dimmer-bulb") + return true, subdriver + else + return false + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/fingerprints.lua new file mode 100644 index 0000000000..9ff7bb0618 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/fingerprints.lua @@ -0,0 +1,114 @@ +return { + ["AduroSmart Eria"] = { + ["ZLL-DimmableLight"] = true, + ["ZLL-ExtendedColor"] = true, + ["ZLL-ColorTemperature"] = true + }, + ["IKEA of Sweden"] = { + ["TRADFRI bulb E26 opal 1000lm"] = true, + ["TRADFRI bulb E12 W op/ch 400lm"] = true, + ["TRADFRI bulb E17 W op/ch 400lm"] = true, + ["TRADFRI bulb GU10 W 400lm"] = true, + ["TRADFRI bulb E27 W opal 1000lm"] = true, + ["TRADFRI bulb E26 W opal 1000lm"] = true, + ["TRADFRI bulb E14 W op/ch 400lm"] = true, + ["TRADFRI transformer 10W"] = true, + ["TRADFRI Driver 10W"] = true, + ["TRADFRI transformer 30W"] = true, + ["TRADFRI Driver 30W"] = true, + ["TRADFRI bulb E26 WS clear 950lm"] = true, + ["TRADFRI bulb GU10 WS 400lm"] = true, + ["TRADFRI bulb E12 WS opal 400lm"] = true, + ["TRADFRI bulb E26 WS opal 980lm"] = true, + ["TRADFRI bulb E27 WS clear 950lm"] = true, + ["TRADFRI bulb E14 WS opal 400lm"] = true, + ["TRADFRI bulb E27 WS opal 980lm"] = true, + ["FLOALT panel WS 30x30"] = true, + ["FLOALT panel WS 30x90"] = true, + ["FLOALT panel WS 60x60"] = true, + ["SURTE door WS 38x64"] = true, + ["JORMLIEN door WS 40x80"] = true, + ["TRADFRI bulb E27 CWS opal 600lm"] = true, + ["TRADFRI bulb E26 CWS opal 600lm"] = true + }, + ["Eaton"] = { + ["Halo_RL5601"] = true + }, + ["Megaman"] = { + ["ZLL-DimmableLight"] = true, + ["ZLL-ExtendedColor"] = true + }, + ["MEGAMAN"] = { + ["BSZTM002"] = true, + ["BSZTM003"] = true + }, + ["innr"] = { + ["RS 125"] = true, + ["RB 165"] = true, + ["RB 175 W"] = true, + ["RB 145"] = true, + ["RS 128 T"] = true, + ["RB 178 T"] = true, + ["RB 148 T"] = true, + ["RB 185 C"] = true, + ["FL 130 C"] = true, + ["OFL 120 C"] = true, + ["OFL 140 C"] = true, + ["OSL 130 C"] = true + }, + ["Leviton"] = { + ["DG3HL"] = true, + ["DG6HD"] = true + }, + ["OSRAM"] = { + ["Classic A60 W clear"] = true, + ["Classic A60 W clear - LIGHTIFY"] = true, + ["CLA60 OFD OSRAM"] = true, + ["Classic A60 RGBW"] = true, + ["PAR 16 50 RGBW - LIGHTIFY"] = true, + ["CLA60 RGBW OSRAM"] = true, + ["Flex RGBW"] = true, + ["Gardenpole RGBW-Lightify"] = true, + ["LIGHTIFY Outdoor Flex RGBW"] = true, + ["LIGHTIFY Indoor Flex RGBW"] = true, + ["Classic B40 TW - LIGHTIFY"] = true, + ["CLA60 TW OSRAM"] = true + }, + ["Philips"] = { + ["LWB006"] = true, + ["LWB007"] = true, + ["LWB010"] = true, + ["LWB014"] = true, + ["LCT001"] = true, + ["LCT002"] = true, + ["LCT003"] = true, + ["LCT007"] = true, + ["LCT010"] = true, + ["LCT011"] = true, + ["LCT012"] = true, + ["LCT014"] = true, + ["LCT015"] = true, + ["LCT016"] = true, + ["LST001"] = true, + ["LST002"] = true, + ["LTW001"] = true, + ["LTW004"] = true, + ["LTW010"] = true, + ["LTW011"] = true, + ["LTW012"] = true, + ["LTW013"] = true, + ["LTW014"] = true, + ["LTW015"] = true + }, + ["sengled"] = { + ["E14-U43"] = true, + ["E13-N11"] = true + }, + ["GLEDOPTO"] = { + ["GL-C-008"] = true, + ["GL-B-001Z"] = true + }, + ["Ubec"] = { + ["BBB65L-HY"] = true + } +} diff --git a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/init.lua index 0f35666fe0..2347345f49 100644 --- a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/init.lua @@ -19,131 +19,6 @@ local colorTemperature_defaults = require "st.zigbee.defaults.colorTemperature_d local OnOff = clusters.OnOff local Level = clusters.Level -local ZLL_DIMMER_BULB_FINGERPRINTS = { - ["AduroSmart Eria"] = { - ["ZLL-DimmableLight"] = true, - ["ZLL-ExtendedColor"] = true, - ["ZLL-ColorTemperature"] = true - }, - ["IKEA of Sweden"] = { - ["TRADFRI bulb E26 opal 1000lm"] = true, - ["TRADFRI bulb E12 W op/ch 400lm"] = true, - ["TRADFRI bulb E17 W op/ch 400lm"] = true, - ["TRADFRI bulb GU10 W 400lm"] = true, - ["TRADFRI bulb E27 W opal 1000lm"] = true, - ["TRADFRI bulb E26 W opal 1000lm"] = true, - ["TRADFRI bulb E14 W op/ch 400lm"] = true, - ["TRADFRI transformer 10W"] = true, - ["TRADFRI Driver 10W"] = true, - ["TRADFRI transformer 30W"] = true, - ["TRADFRI Driver 30W"] = true, - ["TRADFRI bulb E26 WS clear 950lm"] = true, - ["TRADFRI bulb GU10 WS 400lm"] = true, - ["TRADFRI bulb E12 WS opal 400lm"] = true, - ["TRADFRI bulb E26 WS opal 980lm"] = true, - ["TRADFRI bulb E27 WS clear 950lm"] = true, - ["TRADFRI bulb E14 WS opal 400lm"] = true, - ["TRADFRI bulb E27 WS opal 980lm"] = true, - ["FLOALT panel WS 30x30"] = true, - ["FLOALT panel WS 30x90"] = true, - ["FLOALT panel WS 60x60"] = true, - ["SURTE door WS 38x64"] = true, - ["JORMLIEN door WS 40x80"] = true, - ["TRADFRI bulb E27 CWS opal 600lm"] = true, - ["TRADFRI bulb E26 CWS opal 600lm"] = true - }, - ["Eaton"] = { - ["Halo_RL5601"] = true - }, - ["Megaman"] = { - ["ZLL-DimmableLight"] = true, - ["ZLL-ExtendedColor"] = true - }, - ["MEGAMAN"] = { - ["BSZTM002"] = true, - ["BSZTM003"] = true - }, - ["innr"] = { - ["RS 125"] = true, - ["RB 165"] = true, - ["RB 175 W"] = true, - ["RB 145"] = true, - ["RS 128 T"] = true, - ["RB 178 T"] = true, - ["RB 148 T"] = true, - ["RB 185 C"] = true, - ["FL 130 C"] = true, - ["OFL 120 C"] = true, - ["OFL 140 C"] = true, - ["OSL 130 C"] = true - }, - ["Leviton"] = { - ["DG3HL"] = true, - ["DG6HD"] = true - }, - ["OSRAM"] = { - ["Classic A60 W clear"] = true, - ["Classic A60 W clear - LIGHTIFY"] = true, - ["CLA60 OFD OSRAM"] = true, - ["Classic A60 RGBW"] = true, - ["PAR 16 50 RGBW - LIGHTIFY"] = true, - ["CLA60 RGBW OSRAM"] = true, - ["Flex RGBW"] = true, - ["Gardenpole RGBW-Lightify"] = true, - ["LIGHTIFY Outdoor Flex RGBW"] = true, - ["LIGHTIFY Indoor Flex RGBW"] = true, - ["Classic B40 TW - LIGHTIFY"] = true, - ["CLA60 TW OSRAM"] = true - }, - ["Philips"] = { - ["LWB006"] = true, - ["LWB007"] = true, - ["LWB010"] = true, - ["LWB014"] = true, - ["LCT001"] = true, - ["LCT002"] = true, - ["LCT003"] = true, - ["LCT007"] = true, - ["LCT010"] = true, - ["LCT011"] = true, - ["LCT012"] = true, - ["LCT014"] = true, - ["LCT015"] = true, - ["LCT016"] = true, - ["LST001"] = true, - ["LST002"] = true, - ["LTW001"] = true, - ["LTW004"] = true, - ["LTW010"] = true, - ["LTW011"] = true, - ["LTW012"] = true, - ["LTW013"] = true, - ["LTW014"] = true, - ["LTW015"] = true - }, - ["sengled"] = { - ["E14-U43"] = true, - ["E13-N11"] = true - }, - ["GLEDOPTO"] = { - ["GL-C-008"] = true, - ["GL-B-001Z"] = true - }, - ["Ubec"] = { - ["BBB65L-HY"] = true - } -} - -local function can_handle_zll_dimmer_bulb(opts, driver, device) - local can_handle = (ZLL_DIMMER_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] - if can_handle then - local subdriver = require("zll-dimmer-bulb") - return true, subdriver - else - return false - end -end - local function do_configure(driver, device) device:configure() end @@ -204,7 +79,7 @@ local zll_dimmer_bulb = { [capabilities.colorTemperature.commands.setColorTemperature.NAME] = handle_set_color_temperature } }, - can_handle = can_handle_zll_dimmer_bulb + can_handle = require("zll-dimmer-bulb.can_handle"), } return zll_dimmer_bulb diff --git a/drivers/SmartThings/zigbee-switch/src/zll-polling/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zll-polling/can_handle.lua new file mode 100644 index 0000000000..3ddd9b8328 --- /dev/null +++ b/drivers/SmartThings/zigbee-switch/src/zll-polling/can_handle.lua @@ -0,0 +1,11 @@ +return function(opts, driver, device, zb_rx, ...) + local constants = require "st.zigbee.constants" + + local endpoint = device.zigbee_endpoints[device.fingerprinted_endpoint_id] or device.zigbee_endpoints[tostring(device.fingerprinted_endpoint_id)] + if (endpoint ~= nil and endpoint.profile_id == constants.ZLL_PROFILE_ID) then + local subdriver = require("zll-polling") + return true, subdriver + else + return false + end +end diff --git a/drivers/SmartThings/zigbee-switch/src/zll-polling/init.lua b/drivers/SmartThings/zigbee-switch/src/zll-polling/init.lua index 1fa972ca98..ad619e070e 100644 --- a/drivers/SmartThings/zigbee-switch/src/zll-polling/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zll-polling/init.lua @@ -14,17 +14,6 @@ local device_lib = require "st.device" local clusters = require "st.zigbee.zcl.clusters" -local ZLL_PROFILE_ID = 0xC05E - -local function zll_profile(opts, driver, device, zb_rx, ...) - local endpoint = device.zigbee_endpoints[device.fingerprinted_endpoint_id] or device.zigbee_endpoints[tostring(device.fingerprinted_endpoint_id)] - if (endpoint ~= nil and endpoint.profile_id == ZLL_PROFILE_ID) then - local subdriver = require("zll-polling") - return true, subdriver - else - return false - end -end local function set_up_zll_polling(driver, device) local INFREQUENT_POLL_COUNTER = "_infrequent_poll_counter" @@ -57,7 +46,7 @@ local ZLL_polling = { lifecycle_handlers = { init = set_up_zll_polling }, - can_handle = zll_profile + can_handle = require("zll-polling.can_handle"), } -return ZLL_polling \ No newline at end of file +return ZLL_polling From d42421a180b52eae1c557bed10ddf53a26704ec8 Mon Sep 17 00:00:00 2001 From: cjswedes Date: Mon, 3 Nov 2025 15:25:41 -0600 Subject: [PATCH 2/2] Update copywrites to be shorter and add them where missing This is done to maintain consitency across the whole driver and set an example for other drivers to follow. The reduced source file comment should also help with memory savings since comments do affect memory of a driver when the driver code is being loaded into the Lua runtime. --- .../zigbee-switch/src/aqara-light/can_handle.lua | 3 +++ .../zigbee-switch/src/aqara-light/init.lua | 3 +++ .../zigbee-switch/src/aqara/can_handle.lua | 3 +++ .../zigbee-switch/src/aqara/fingerprints.lua | 3 +++ .../SmartThings/zigbee-switch/src/aqara/init.lua | 3 +++ .../src/aqara/multi-switch/can_handle.lua | 3 +++ .../src/aqara/multi-switch/fingerprints.lua | 3 +++ .../src/aqara/multi-switch/init.lua | 3 +++ .../zigbee-switch/src/aqara/sub_drivers.lua | 3 +++ .../src/aqara/version/can_handle.lua | 3 +++ .../zigbee-switch/src/aqara/version/init.lua | 3 +++ .../src/bad_on_off_data_type/can_handle.lua | 3 +++ .../src/bad_on_off_data_type/init.lua | 15 ++------------- .../zigbee-switch/src/configurations/devices.lua | 15 ++------------- .../zigbee-switch/src/configurations/init.lua | 15 ++------------- .../zigbee-switch/src/ezex/can_handle.lua | 3 +++ .../SmartThings/zigbee-switch/src/ezex/init.lua | 15 ++------------- .../zigbee-switch/src/frient/can_handle.lua | 3 +++ .../zigbee-switch/src/frient/fingerprints.lua | 3 +++ .../zigbee-switch/src/frient/init.lua | 15 ++------------- .../src/ge-link-bulb/can_handle.lua | 3 +++ .../zigbee-switch/src/ge-link-bulb/init.lua | 15 ++------------- .../zigbee-switch/src/hanssem/can_handle.lua | 3 +++ .../zigbee-switch/src/hanssem/fingerprints.lua | 3 +++ .../zigbee-switch/src/hanssem/init.lua | 15 ++------------- .../src/ikea-xy-color-bulb/can_handle.lua | 3 +++ .../src/ikea-xy-color-bulb/init.lua | 15 ++------------- drivers/SmartThings/zigbee-switch/src/init.lua | 15 ++------------- .../zigbee-switch/src/inovelli/can_handle.lua | 3 +++ .../zigbee-switch/src/inovelli/common.lua | 15 ++------------- .../zigbee-switch/src/inovelli/init.lua | 15 ++------------- .../zigbee-switch/src/inovelli/sub_drivers.lua | 3 +++ .../src/inovelli/vzm32-sn/can_handle.lua | 3 +++ .../zigbee-switch/src/inovelli/vzm32-sn/init.lua | 15 ++------------- .../zigbee-switch/src/jasco/can_handle.lua | 3 +++ .../SmartThings/zigbee-switch/src/jasco/init.lua | 15 ++------------- .../zigbee-switch/src/laisiao/can_handle.lua | 3 +++ .../zigbee-switch/src/laisiao/init.lua | 15 ++------------- .../zigbee-switch/src/lazy_load_subdriver.lua | 3 +++ .../src/lifecycle_handlers/device_added.lua | 15 ++------------- .../src/lifecycle_handlers/do_configure.lua | 15 ++------------- .../src/lifecycle_handlers/find_child.lua | 15 ++------------- .../src/lifecycle_handlers/info_changed.lua | 15 ++------------- .../src/multi-switch-no-master/can_handle.lua | 3 +++ .../src/multi-switch-no-master/fingerprints.lua | 3 +++ .../src/multi-switch-no-master/init.lua | 15 ++------------- .../src/non_zigbee_devices/can_handle.lua | 3 +++ .../src/non_zigbee_devices/init.lua | 15 ++------------- .../zigbee-switch/src/preferences.lua | 15 ++------------- .../zigbee-switch/src/rexense/can_handle.lua | 3 +++ .../zigbee-switch/src/rexense/init.lua | 15 ++------------- .../zigbee-switch/src/rgb-bulb/can_handle.lua | 3 +++ .../zigbee-switch/src/rgb-bulb/init.lua | 15 ++------------- .../zigbee-switch/src/rgbw-bulb/can_handle.lua | 3 +++ .../zigbee-switch/src/rgbw-bulb/fingerprints.lua | 3 +++ .../zigbee-switch/src/rgbw-bulb/init.lua | 15 ++------------- .../zigbee-switch/src/robb/can_handle.lua | 3 +++ .../SmartThings/zigbee-switch/src/robb/init.lua | 15 ++------------- .../src/sinope-dimmer/can_handle.lua | 3 +++ .../zigbee-switch/src/sinope-dimmer/init.lua | 15 ++------------- .../zigbee-switch/src/sinope/can_handle.lua | 3 +++ .../zigbee-switch/src/sinope/init.lua | 15 ++------------- .../zigbee-switch/src/switch_utils.lua | 15 ++------------- .../src/test/test_all_capability_zigbee_bulb.lua | 15 ++------------- .../src/test/test_aqara_led_bulb.lua | 15 ++------------- .../zigbee-switch/src/test/test_aqara_light.lua | 15 ++------------- .../src/test/test_aqara_smart_plug.lua | 15 ++------------- .../src/test/test_aqara_smart_plug_t1.lua | 15 ++------------- .../src/test/test_aqara_switch_module.lua | 15 ++------------- .../test/test_aqara_switch_module_no_power.lua | 15 ++------------- .../src/test/test_aqara_switch_no_power.lua | 15 ++------------- .../src/test/test_aqara_switch_power.lua | 15 ++------------- .../src/test/test_aqara_wall_switch.lua | 15 ++------------- .../zigbee-switch/src/test/test_aurora_relay.lua | 15 ++------------- .../src/test/test_bad_data_type.lua | 16 ++-------------- .../src/test/test_bad_device_kind.lua | 15 ++------------- .../zigbee-switch/src/test/test_cree_bulb.lua | 15 ++------------- .../src/test/test_duragreen_color_temp_bulb.lua | 15 ++------------- .../src/test/test_enbrighten_metering_dimmer.lua | 15 ++------------- .../src/test/test_frient_switch.lua | 15 ++------------- .../zigbee-switch/src/test/test_ge_link_bulb.lua | 15 ++------------- .../src/test/test_hanssem_switch.lua | 15 ++------------- .../src/test/test_inovelli_vzm31_sn.lua | 15 ++------------- .../src/test/test_inovelli_vzm31_sn_child.lua | 15 ++------------- .../test/test_inovelli_vzm31_sn_preferences.lua | 15 ++------------- .../src/test/test_inovelli_vzm32_sn.lua | 15 ++------------- .../src/test/test_inovelli_vzm32_sn_child.lua | 15 ++------------- .../test/test_inovelli_vzm32_sn_preferences.lua | 15 ++------------- .../zigbee-switch/src/test/test_jasco_switch.lua | 15 ++------------- .../src/test/test_laisiao_bath_heather.lua | 15 ++------------- .../zigbee-switch/src/test/test_multi_switch.lua | 15 ++------------- .../src/test/test_multi_switch_no_master.lua | 15 ++------------- .../src/test/test_multi_switch_power.lua | 15 ++------------- .../src/test/test_on_off_zigbee_bulb.lua | 15 ++------------- .../src/test/test_osram_iqbr30_light.lua | 15 ++------------- .../zigbee-switch/src/test/test_osram_light.lua | 15 ++------------- .../zigbee-switch/src/test/test_rgb_bulb.lua | 15 ++------------- .../zigbee-switch/src/test/test_rgbw_bulb.lua | 15 ++------------- .../src/test/test_robb_smarrt_2-wire_dimmer.lua | 15 ++------------- .../src/test/test_robb_smarrt_knob_dimmer.lua | 15 ++------------- .../src/test/test_sengled_color_temp_bulb.lua | 15 ++------------- ...st_sengled_dimmer_bulb_with_motion_sensor.lua | 15 ++------------- .../src/test/test_sinope_dimmer.lua | 15 ++------------- .../src/test/test_sinope_switch.lua | 15 ++------------- .../zigbee-switch/src/test/test_switch_power.lua | 15 ++------------- .../zigbee-switch/src/test/test_tuya_multi.lua | 15 ++------------- .../src/test/test_tuya_multi_switch.lua | 15 ++------------- .../src/test/test_wallhero_switch.lua | 15 ++------------- .../src/test/test_white_color_temp_bulb.lua | 15 ++------------- .../src/test/test_zigbee_ezex_switch.lua | 15 ++------------- ...ee_metering_plug_power_consumption_report.lua | 15 ++------------- .../test/test_zigbee_metering_plug_rexense.lua | 15 ++------------- .../src/test/test_zll_color_temp_bulb.lua | 15 ++------------- .../zigbee-switch/src/test/test_zll_dimmer.lua | 15 ++------------- .../src/test/test_zll_dimmer_bulb.lua | 15 ++------------- .../zigbee-switch/src/test/test_zll_rgb_bulb.lua | 15 ++------------- .../src/test/test_zll_rgbw_bulb.lua | 15 ++------------- .../zigbee-switch/src/tuya-multi/can_handle.lua | 3 +++ .../zigbee-switch/src/tuya-multi/init.lua | 3 +++ .../zigbee-switch/src/wallhero/can_handle.lua | 3 +++ .../zigbee-switch/src/wallhero/fingerprints.lua | 3 +++ .../zigbee-switch/src/wallhero/init.lua | 15 ++------------- .../src/white-color-temp-bulb/can_handle.lua | 3 +++ .../duragreen/can_handle.lua | 3 +++ .../src/white-color-temp-bulb/duragreen/init.lua | 15 ++------------- .../src/white-color-temp-bulb/fingerprints.lua | 3 +++ .../src/white-color-temp-bulb/init.lua | 15 ++------------- .../src/white-color-temp-bulb/sub_drivers.lua | 3 +++ .../zigbee-dimmer-power-energy/can_handle.lua | 3 +++ .../src/zigbee-dimmer-power-energy/init.lua | 15 ++------------- .../src/zigbee-dimming-light/can_handle.lua | 3 +++ .../src/zigbee-dimming-light/fingerprints.lua | 3 +++ .../src/zigbee-dimming-light/init.lua | 15 ++------------- .../osram-iqbr30/can_handle.lua | 3 +++ .../zigbee-dimming-light/osram-iqbr30/init.lua | 15 ++------------- .../src/zigbee-dimming-light/sub_drivers.lua | 3 +++ .../zll-dimmer/can_handle.lua | 3 +++ .../zll-dimmer/fingerprints.lua | 3 +++ .../src/zigbee-dimming-light/zll-dimmer/init.lua | 15 ++------------- .../zigbee-dual-metering-switch/can_handle.lua | 3 +++ .../src/zigbee-dual-metering-switch/init.lua | 15 ++------------- .../can_handle.lua | 3 +++ .../init.lua | 15 ++------------- .../aurora-relay/can_handle.lua | 3 +++ .../zigbee-switch-power/aurora-relay/init.lua | 15 ++------------- .../src/zigbee-switch-power/can_handle.lua | 3 +++ .../src/zigbee-switch-power/fingerprints.lua | 3 +++ .../src/zigbee-switch-power/init.lua | 15 ++------------- .../src/zigbee-switch-power/sub_drivers.lua | 3 +++ .../src/zigbee-switch-power/vimar/can_handle.lua | 3 +++ .../src/zigbee-switch-power/vimar/init.lua | 15 ++------------- .../src/zll-dimmer-bulb/can_handle.lua | 3 +++ .../src/zll-dimmer-bulb/fingerprints.lua | 3 +++ .../zigbee-switch/src/zll-dimmer-bulb/init.lua | 15 ++------------- .../zigbee-switch/src/zll-polling/can_handle.lua | 3 +++ .../zigbee-switch/src/zll-polling/init.lua | 15 ++------------- 156 files changed, 372 insertions(+), 1249 deletions(-) diff --git a/drivers/SmartThings/zigbee-switch/src/aqara-light/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara-light/can_handle.lua index 1900934725..73ea4c3d00 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara-light/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara-light/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local FINGERPRINTS = { { mfr = "LUMI", model = "lumi.light.acn004" }, diff --git a/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua index ec6e178f42..760ffebebf 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local clusters = require "st.zigbee.zcl.clusters" local cluster_base = require "st.zigbee.cluster_base" local data_types = require "st.zigbee.data_types" diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua index 312e3a7e08..e183f78266 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local FINGERPRINTS = require("aqara.fingerprints") for _, fingerprint in ipairs(FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua index 837b3243b8..63f94e2be3 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { { mfr = "LUMI", model = "lumi.plug.maeu01" }, { mfr = "LUMI", model = "lumi.plug.macn01" }, diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/init.lua index c4acb83a94..0c64b594fe 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/init.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua index 26eb425583..1524296cff 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local FINGERPRINTS = require("aqara.multi-switch.fingerprints") for _, fingerprint in ipairs(FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua index e8bfe86866..71ed1b26b3 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { { mfr = "LUMI", model = "lumi.switch.n1acn1", children = 1, child_profile = "" }, { mfr = "LUMI", model = "lumi.switch.n2acn1", children = 2, child_profile = "aqara-switch-child" }, diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua index cf143091e7..9280a30d0d 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/multi-switch/init.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local device_lib = require "st.device" local capabilities = require "st.capabilities" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/aqara/sub_drivers.lua index cf4fec5466..d064785cb4 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/sub_drivers.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/sub_drivers.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local lazy_load = require "lazy_load_subdriver" return { diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/version/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/aqara/version/can_handle.lua index 780b53a434..d56744fefa 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/version/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/version/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function (opts, driver, device) local PRIVATE_MODE = "PRIVATE_MODE" local private_mode = device:get_field(PRIVATE_MODE) or 0 diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua index 6e3b5ab125..bca3e9fb88 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/version/init.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" local constants = require "st.zigbee.constants" diff --git a/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/can_handle.lua index 7b9510968d..49b42ddb35 100644 --- a/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + -- There are reports of at least one device (SONOFF 01MINIZB) which occasionally -- reports this value as an Int8, rather than a Boolean, as per the spec diff --git a/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/init.lua b/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/init.lua index 863d1e4ec4..2a59166bbb 100644 --- a/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/bad_on_off_data_type/init.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local zcl_clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/configurations/devices.lua b/drivers/SmartThings/zigbee-switch/src/configurations/devices.lua index 51fd1c3665..9910dde229 100644 --- a/drivers/SmartThings/zigbee-switch/src/configurations/devices.lua +++ b/drivers/SmartThings/zigbee-switch/src/configurations/devices.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local ColorControl = clusters.ColorControl diff --git a/drivers/SmartThings/zigbee-switch/src/configurations/init.lua b/drivers/SmartThings/zigbee-switch/src/configurations/init.lua index 2e1c4e2fc9..01f42abf91 100644 --- a/drivers/SmartThings/zigbee-switch/src/configurations/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/configurations/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local CONFIGURATION_VERSION_KEY = "_configuration_version" diff --git a/drivers/SmartThings/zigbee-switch/src/ezex/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/ezex/can_handle.lua index 454f140209..4bb61719ff 100644 --- a/drivers/SmartThings/zigbee-switch/src/ezex/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/ezex/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local ZIGBEE_METERING_SWITCH_FINGERPRINTS = { { model = "E240-KR116Z-HA" } diff --git a/drivers/SmartThings/zigbee-switch/src/ezex/init.lua b/drivers/SmartThings/zigbee-switch/src/ezex/init.lua index 7f338e1b11..6c2d9e45e3 100644 --- a/drivers/SmartThings/zigbee-switch/src/ezex/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/ezex/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local zigbee_constants = require "st.zigbee.constants" local configurations = require "configurations" diff --git a/drivers/SmartThings/zigbee-switch/src/frient/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/frient/can_handle.lua index 1c23272f30..2892763034 100644 --- a/drivers/SmartThings/zigbee-switch/src/frient/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/frient/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + -- Function to determine if the driver can handle this device return function(opts, driver, device, ...) local FRIENT_SMART_PLUG_FINGERPRINTS = require("frient.fingerprints") diff --git a/drivers/SmartThings/zigbee-switch/src/frient/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/frient/fingerprints.lua index a9c7333473..e2ac5ceaab 100644 --- a/drivers/SmartThings/zigbee-switch/src/frient/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/frient/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { { mfr = "frient A/S", model = "SPLZB-131" }, { mfr = "frient A/S", model = "SPLZB-132" }, diff --git a/drivers/SmartThings/zigbee-switch/src/frient/init.lua b/drivers/SmartThings/zigbee-switch/src/frient/init.lua index af85f237a6..a615c721f4 100644 --- a/drivers/SmartThings/zigbee-switch/src/frient/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/frient/init.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/can_handle.lua index 08ce9c471f..6addbc463c 100644 --- a/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local GE_LINK_BULB_FINGERPRINTS = { ["GE_Appliances"] = { diff --git a/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua index 51bab5110f..b1f5ea8508 100644 --- a/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/ge-link-bulb/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/hanssem/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/hanssem/can_handle.lua index de9c477317..9f9f1c4ace 100644 --- a/drivers/SmartThings/zigbee-switch/src/hanssem/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/hanssem/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device, ...) local FINGERPRINTS = require "hanssem.fingerprints" for _, fingerprint in ipairs(FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/hanssem/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/hanssem/fingerprints.lua index 67d2f40022..65c4421053 100644 --- a/drivers/SmartThings/zigbee-switch/src/hanssem/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/hanssem/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { { mfr = "Winners", model = "LSS1-101", children = 0 }, { mfr = "Winners", model = "LSS1-102", children = 1 }, diff --git a/drivers/SmartThings/zigbee-switch/src/hanssem/init.lua b/drivers/SmartThings/zigbee-switch/src/hanssem/init.lua index e1f9939946..083893448b 100644 --- a/drivers/SmartThings/zigbee-switch/src/hanssem/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/hanssem/init.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local stDevice = require "st.device" local configurations = require "configurations" diff --git a/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/can_handle.lua index 3c507a2627..47992c0559 100644 --- a/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local IKEA_XY_COLOR_BULB_FINGERPRINTS = { diff --git a/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/init.lua index 193d032336..a026ac6564 100644 --- a/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/ikea-xy-color-bulb/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/init.lua b/drivers/SmartThings/zigbee-switch/src/init.lua index 8a7a05a9cb..696ff8ada9 100644 --- a/drivers/SmartThings/zigbee-switch/src/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- The only reason we need this is because of supported_capabilities on the driver template local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/can_handle.lua index 325c2bc973..473c1cb807 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local INOVELLI_FINGERPRINTS = { diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/common.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/common.lua index c80d0deca9..33d3ff577c 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/common.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/common.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local device_management = require "st.zigbee.device_management" diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua index dd261cdd8a..73967b41f3 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/init.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/sub_drivers.lua index c7f0c32bfc..20677e4764 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/sub_drivers.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/sub_drivers.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local lazy_load = require "lazy_load_subdriver" return { diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/can_handle.lua index e2496028a3..aa0004b193 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local INOVELLI_VZM32_SN_FINGERPRINTS = { diff --git a/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua b/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua index 6b46885553..edadf85b90 100644 --- a/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/inovelli/vzm32-sn/init.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/jasco/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/jasco/can_handle.lua index be9bd75694..c97ff700c8 100644 --- a/drivers/SmartThings/zigbee-switch/src/jasco/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/jasco/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local JASCO_SWTICH_FINGERPRINTS = { { mfr = "Jasco Products", model = "43095" }, diff --git a/drivers/SmartThings/zigbee-switch/src/jasco/init.lua b/drivers/SmartThings/zigbee-switch/src/jasco/init.lua index 250903d46a..a21059dfb4 100644 --- a/drivers/SmartThings/zigbee-switch/src/jasco/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/jasco/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/laisiao/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/laisiao/can_handle.lua index 991547f9d1..7ed921844b 100644 --- a/drivers/SmartThings/zigbee-switch/src/laisiao/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/laisiao/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device, ...) local FINGERPRINTS = { { mfr = "LAISIAO", model = "yuba" }, diff --git a/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua b/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua index 5a26e01f34..2833843793 100755 --- a/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/laisiao/init.lua @@ -1,16 +1,5 @@ --- Copyright 2024 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local zcl_clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua b/drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua index 80dc2101ae..0bee6d2a75 100644 --- a/drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua +++ b/drivers/SmartThings/zigbee-switch/src/lazy_load_subdriver.lua @@ -1,3 +1,6 @@ +-- 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 version = require "version" diff --git a/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/device_added.lua b/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/device_added.lua index 275b7e4b27..a241ea506c 100644 --- a/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/device_added.lua +++ b/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/device_added.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local find_child = require "lifecycle_handlers.find_child" diff --git a/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/do_configure.lua b/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/do_configure.lua index 088cc604b4..465969a755 100644 --- a/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/do_configure.lua +++ b/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/do_configure.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" return function(self, device) diff --git a/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/find_child.lua b/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/find_child.lua index e33df67817..31b1640619 100644 --- a/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/find_child.lua +++ b/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/find_child.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 return function(parent, ep_id) return parent:get_child_by_parent_assigned_key(string.format("%02X", ep_id)) diff --git a/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/info_changed.lua b/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/info_changed.lua index 9699760a92..bd15064b5e 100644 --- a/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/info_changed.lua +++ b/drivers/SmartThings/zigbee-switch/src/lifecycle_handlers/info_changed.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 return function(self, device, event, args) local preferences = require "preferences" diff --git a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/can_handle.lua index d780d70d06..80cd735e93 100644 --- a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local FINGERPRINTS = require "multi-switch-no-master.fingerprints" for _, fingerprint in ipairs(FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/fingerprints.lua index f8bb368525..ca54566d8d 100644 --- a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { { mfr = "DAWON_DNS", model = "PM-S240-ZB", children = 1 }, { mfr = "DAWON_DNS", model = "PM-S240R-ZB", children = 1 }, diff --git a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua index 85bfb6ae96..ba0ed07ae3 100644 --- a/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/multi-switch-no-master/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local st_device = require "st.device" local utils = require "st.utils" local configurations = require "configurations" diff --git a/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/can_handle.lua index ce1a124104..bc394d4fa0 100644 --- a/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local st_device = require "st.device" diff --git a/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/init.lua b/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/init.lua index 628eb825ff..63876e658a 100644 --- a/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/non_zigbee_devices/init.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- This is a patch for the zigbee-switch driver to fix https://smartthings.atlassian.net/browse/CHAD-16558 -- Several hubs were found that had zigbee switch drivers hosting zwave devices. diff --git a/drivers/SmartThings/zigbee-switch/src/preferences.lua b/drivers/SmartThings/zigbee-switch/src/preferences.lua index f0170aaf40..9b8a0cb66d 100644 --- a/drivers/SmartThings/zigbee-switch/src/preferences.lua +++ b/drivers/SmartThings/zigbee-switch/src/preferences.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/rexense/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/rexense/can_handle.lua index 7fee03f115..bcdc666417 100644 --- a/drivers/SmartThings/zigbee-switch/src/rexense/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/rexense/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local ZIGBEE_METERING_PLUG_FINGERPRINTS = { { mfr = "REXENSE", model = "HY0105" } -- HONYAR Outlet" diff --git a/drivers/SmartThings/zigbee-switch/src/rexense/init.lua b/drivers/SmartThings/zigbee-switch/src/rexense/init.lua index 598afa75ec..4b16afe3b0 100644 --- a/drivers/SmartThings/zigbee-switch/src/rexense/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/rexense/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local zcl_clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/rgb-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/rgb-bulb/can_handle.lua index 6d255174d6..e52cf32dcd 100644 --- a/drivers/SmartThings/zigbee-switch/src/rgb-bulb/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/rgb-bulb/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local RGB_BULB_FINGERPRINTS = { ["OSRAM"] = { diff --git a/drivers/SmartThings/zigbee-switch/src/rgb-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/rgb-bulb/init.lua index 03ed2b1574..867b069bfe 100644 --- a/drivers/SmartThings/zigbee-switch/src/rgb-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/rgb-bulb/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/can_handle.lua index 77c16d7b90..724bb6266a 100644 --- a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local RGBW_BULB_FINGERPRINTS = require "rgbw-bulb.fingerprints" local can_handle = (RGBW_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] diff --git a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/fingerprints.lua index e0c8c3dd93..c8eedcfec8 100644 --- a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { ["Samsung Electronics"] = { ["SAMSUNG-ITM-Z-002"] = true diff --git a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/init.lua index aa9b25e9ae..cfa2c81855 100644 --- a/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/rgbw-bulb/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/robb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/robb/can_handle.lua index 4544c17d64..480bc83ab5 100644 --- a/drivers/SmartThings/zigbee-switch/src/robb/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/robb/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local ROBB_DIMMER_FINGERPRINTS = { { mfr = "ROBB smarrt", model = "ROB_200-011-0" }, diff --git a/drivers/SmartThings/zigbee-switch/src/robb/init.lua b/drivers/SmartThings/zigbee-switch/src/robb/init.lua index 9081d058db..1a8c2948c3 100644 --- a/drivers/SmartThings/zigbee-switch/src/robb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/robb/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local constants = require "st.zigbee.constants" local zcl_clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/can_handle.lua index 326de13801..3a7233e6b9 100644 --- a/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device, ...) local can_handle = device:get_manufacturer() == "Sinope Technologies" and device:get_model() == "DM2500ZB" if can_handle then diff --git a/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/init.lua b/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/init.lua index c2aba06bda..d97c873467 100644 --- a/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/sinope-dimmer/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/sinope/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/sinope/can_handle.lua index 90b7965184..624baee756 100644 --- a/drivers/SmartThings/zigbee-switch/src/sinope/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/sinope/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device, ...) local can_handle = device:get_manufacturer() == "Sinope Technologies" and device:get_model() == "SW2500ZB" if can_handle then diff --git a/drivers/SmartThings/zigbee-switch/src/sinope/init.lua b/drivers/SmartThings/zigbee-switch/src/sinope/init.lua index a7101bb971..af0300a377 100644 --- a/drivers/SmartThings/zigbee-switch/src/sinope/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/sinope/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local cluster_base = require "st.zigbee.cluster_base" local data_types = require "st.zigbee.data_types" diff --git a/drivers/SmartThings/zigbee-switch/src/switch_utils.lua b/drivers/SmartThings/zigbee-switch/src/switch_utils.lua index 7f5429dceb..66ad4715f9 100644 --- a/drivers/SmartThings/zigbee-switch/src/switch_utils.lua +++ b/drivers/SmartThings/zigbee-switch/src/switch_utils.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local switch_utils = {} diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua index 319066fa3b..70dfc96780 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua index 9c7a7cc0e5..8584e74e1d 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua index 68f54c986f..814de3f055 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua index d9edfbe425..0d51bd11c2 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua index c1ba5bef7d..8a544caf13 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua index e0038602fb..f27d84cfc6 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module_no_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module_no_power.lua index 6ed61191da..840aadacb9 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module_no_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module_no_power.lua @@ -1,16 +1,5 @@ --- Copyright 2024 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_no_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_no_power.lua index e35a1c25e5..207e7bf21b 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_no_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_no_power.lua @@ -1,16 +1,5 @@ --- Copyright 2024 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_power.lua index 8b596191a5..a02ef37aa2 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_power.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_wall_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_wall_switch.lua index b47d0595c8..3711116d99 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_wall_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_wall_switch.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aurora_relay.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aurora_relay.lua index 6dd6ed75b7..57d6576955 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aurora_relay.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aurora_relay.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_bad_data_type.lua b/drivers/SmartThings/zigbee-switch/src/test/test_bad_data_type.lua index 69ee7f043a..b30f49df23 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_bad_data_type.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_bad_data_type.lua @@ -1,17 +1,5 @@ - --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_bad_device_kind.lua b/drivers/SmartThings/zigbee-switch/src/test/test_bad_device_kind.lua index 3f66d675c9..bd8ce15b10 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_bad_device_kind.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_bad_device_kind.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_cree_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_cree_bulb.lua index e971201f85..8841c5a53d 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_cree_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_cree_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_duragreen_color_temp_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_duragreen_color_temp_bulb.lua index 0dee55ebf4..55c491e77d 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_duragreen_color_temp_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_duragreen_color_temp_bulb.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_enbrighten_metering_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_enbrighten_metering_dimmer.lua index 3b8c7187b4..3b5a5b93b1 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_enbrighten_metering_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_enbrighten_metering_dimmer.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_frient_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_frient_switch.lua index 8b9b26ba13..4290d6ebbe 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_frient_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_frient_switch.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_ge_link_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_ge_link_bulb.lua index cdcd49c616..d37dafe45d 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_ge_link_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_ge_link_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_hanssem_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_hanssem_switch.lua index 37de10bdec..96f4581310 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_hanssem_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_hanssem_switch.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn.lua index 65a3084022..d70159dde5 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_child.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_child.lua index b6c6c86a38..c6476cba5e 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_child.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_child.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_preferences.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_preferences.lua index a9e8850b7d..64b0d51ee5 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_preferences.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm31_sn_preferences.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn.lua index 452b98454d..debdeba110 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_child.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_child.lua index d660e8c501..26346c04a9 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_child.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_child.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_preferences.lua b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_preferences.lua index 9bb0a07147..28ae4829a0 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_preferences.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_inovelli_vzm32_sn_preferences.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_jasco_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_jasco_switch.lua index 750ef895f2..52ba3ef2a6 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_jasco_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_jasco_switch.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_laisiao_bath_heather.lua b/drivers/SmartThings/zigbee-switch/src/test/test_laisiao_bath_heather.lua index ec90d234d8..0457c0eb62 100755 --- a/drivers/SmartThings/zigbee-switch/src/test/test_laisiao_bath_heather.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_laisiao_bath_heather.lua @@ -1,16 +1,5 @@ --- Copyright 2024 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch.lua index 4b5a10ecfb..1ff11bd754 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_no_master.lua b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_no_master.lua index 6d1cf40e63..6603a0831c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_no_master.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_no_master.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_power.lua index c9e16aadad..4e35d5067d 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_multi_switch_power.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_on_off_zigbee_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_on_off_zigbee_bulb.lua index 51ea4fe9c6..7f0d412016 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_on_off_zigbee_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_on_off_zigbee_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_osram_iqbr30_light.lua b/drivers/SmartThings/zigbee-switch/src/test/test_osram_iqbr30_light.lua index aa366750d8..082aa0c5c2 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_osram_iqbr30_light.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_osram_iqbr30_light.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_osram_light.lua b/drivers/SmartThings/zigbee-switch/src/test/test_osram_light.lua index 3efe35fc49..8e2e847e2c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_osram_light.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_osram_light.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_rgb_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_rgb_bulb.lua index 5f7e37f5eb..68af9fdedb 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_rgb_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_rgb_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua index 61a9fcf1ac..24ec471c9d 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_rgbw_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_2-wire_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_2-wire_dimmer.lua index d533d69489..1c815e2d7c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_2-wire_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_2-wire_dimmer.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_knob_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_knob_dimmer.lua index d7e4db0f09..3ed587916c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_knob_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_robb_smarrt_knob_dimmer.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua index c528e22c92..e2ddba42d3 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_sengled_color_temp_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_sengled_dimmer_bulb_with_motion_sensor.lua b/drivers/SmartThings/zigbee-switch/src/test/test_sengled_dimmer_bulb_with_motion_sensor.lua index 2ccaf7be36..e28c4de0b6 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_sengled_dimmer_bulb_with_motion_sensor.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_sengled_dimmer_bulb_with_motion_sensor.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_sinope_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_sinope_dimmer.lua index d1aadf29a3..0859138a8c 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_sinope_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_sinope_dimmer.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local base64 = require "st.base64" local cluster_base = require "st.zigbee.cluster_base" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_sinope_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_sinope_switch.lua index 35242deb6c..34e5f78640 100755 --- a/drivers/SmartThings/zigbee-switch/src/test/test_sinope_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_sinope_switch.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local base64 = require "st.base64" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_switch_power.lua b/drivers/SmartThings/zigbee-switch/src/test/test_switch_power.lua index d4d427bc58..04c17b15de 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_switch_power.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_switch_power.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi.lua b/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi.lua index 45f3d4e2b3..a00f74bddf 100755 --- a/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi_switch.lua index 41924e891d..1ff11bd754 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_tuya_multi_switch.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua index 26e72466c9..ce1a9e2882 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_white_color_temp_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_white_color_temp_bulb.lua index eea20eb184..f024aa45be 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_white_color_temp_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_white_color_temp_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local t_utils = require "integration_test.utils" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_ezex_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_ezex_switch.lua index 88470b5489..8995523952 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_ezex_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_ezex_switch.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_power_consumption_report.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_power_consumption_report.lua index 5128aa1cb4..4514a90cbb 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_power_consumption_report.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_power_consumption_report.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_rexense.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_rexense.lua index a3be084eb2..e1519a4d1a 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_rexense.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zigbee_metering_plug_rexense.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 -- Mock out globals local test = require "integration_test" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_color_temp_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_color_temp_bulb.lua index fc68ec7786..1a13044f48 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_color_temp_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_color_temp_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer.lua index eb590c3874..71305fba20 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer_bulb.lua index a82dac084a..0ac17313d3 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_dimmer_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua index 7bf6b175cd..3435b22288 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgbw_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgbw_bulb.lua index 7945b8d030..cf53f7e359 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgbw_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgbw_bulb.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local test = require "integration_test" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua index f471c99151..c4878c95c2 100644 --- a/drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/tuya-multi/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local function is_multi_endpoint(device) local main_endpoint = device:get_endpoint(0x0006) for _, ep in ipairs(device.zigbee_endpoints) do diff --git a/drivers/SmartThings/zigbee-switch/src/tuya-multi/init.lua b/drivers/SmartThings/zigbee-switch/src/tuya-multi/init.lua index b0c7b85202..51c91ad768 100644 --- a/drivers/SmartThings/zigbee-switch/src/tuya-multi/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/tuya-multi/init.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" local data_types = require "st.zigbee.data_types" diff --git a/drivers/SmartThings/zigbee-switch/src/wallhero/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/wallhero/can_handle.lua index d63ed62a49..69bcf73fce 100644 --- a/drivers/SmartThings/zigbee-switch/src/wallhero/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/wallhero/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device, ...) local FINGERPRINTS = require "wallhero.fingerprints" for _, fingerprint in ipairs(FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/wallhero/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/wallhero/fingerprints.lua index c352b6feb4..9d58e6457a 100644 --- a/drivers/SmartThings/zigbee-switch/src/wallhero/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/wallhero/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { { mfr = "WALL HERO", model = "ACL-401S4I", switches = 4, buttons = 0 }, { mfr = "WALL HERO", model = "ACL-401S8I", switches = 4, buttons = 4 }, diff --git a/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua b/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua index 531a7c4bf2..1e0e7eb26e 100644 --- a/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local log = require "log" diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/can_handle.lua index 1b609d16ad..d45b7b745f 100644 --- a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local WHITE_COLOR_TEMP_BULB_FINGERPRINTS = require "white-color-temp-bulb.fingerprints" local can_handle = (WHITE_COLOR_TEMP_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/can_handle.lua index 2b4c439e64..b3b8bd591b 100644 --- a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local DURAGREEN_BULB_FINGERPRINTS = { ["DURAGREEN"] = { diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/init.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/init.lua index 4c6d134e0e..b6f96842c3 100644 --- a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/duragreen/init.lua @@ -1,16 +1,5 @@ --- Copyright 2023 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/fingerprints.lua index 6824bf40ae..02bb28e88c 100644 --- a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { ["DURAGREEN"] = { ["DG-CW-02"] = true, diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/init.lua index 40b482604c..25bc13b65f 100644 --- a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/sub_drivers.lua index 450c97b97b..9beaf743bc 100644 --- a/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/sub_drivers.lua +++ b/drivers/SmartThings/zigbee-switch/src/white-color-temp-bulb/sub_drivers.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local lazy_load = require "lazy_load_subdriver" return { lazy_load("white-color-temp-bulb.duragreen"), diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/can_handle.lua index 7776397269..7b13c4b630 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local ZIGBEE_DIMMER_POWER_ENERGY_FINGERPRINTS = { { mfr = "Jasco Products", model = "43082" } } diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/init.lua index b3c1a61969..dc37bf1181 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimmer-power-energy/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/can_handle.lua index 1c2f6d3f69..cbbc8dfeab 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local DIMMING_LIGHT_FINGERPRINTS = require "zigbee-dimming-light.fingerprints" for _, fingerprint in ipairs(DIMMING_LIGHT_FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/fingerprints.lua index b90edb17e8..820bd633b6 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { {mfr = "Vimar", model = "DimmerSwitch_v1.0"}, -- Vimar Smart Dimmer Switch {mfr = "OSRAM", model = "LIGHTIFY A19 ON/OFF/DIM"}, -- SYLVANIA Smart A19 Soft White diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/init.lua index 9b05f3092f..dc8629c57b 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/can_handle.lua index a5cf2faff0..8463ce2a77 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device, ...) local res = device:get_manufacturer() == "OSRAM SYLVANIA" and device:get_model() == "iQBR30" if res then diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/init.lua index 43d22558b8..74d9acb903 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/osram-iqbr30/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/sub_drivers.lua index 6251d62343..fa188a4e7e 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/sub_drivers.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/sub_drivers.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local lazy_load = require "lazy_load_subdriver" return { diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/can_handle.lua index cba10b4d8a..d75b86b353 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local ZLL_DIMMER_FINGERPRINTS = require("zigbee-dimming-light.zll-dimmer.fingerprints") for _, fingerprint in ipairs(ZLL_DIMMER_FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/fingerprints.lua index c41f026088..1a5176bcd5 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { {mfr = "Leviton", model = "DL6HD"}, -- Leviton Dimmer Switch {mfr = "Leviton", model = "DL3HL"}, -- Leviton Lumina RF Plug-In Dimmer diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/init.lua index e42846b6a9..039b049fc7 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dimming-light/zll-dimmer/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/can_handle.lua index 37c655bee3..fbc679fb18 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local ZIGBEE_DUAL_METERING_SWITCH_FINGERPRINT = { {mfr = "Aurora", model = "DoubleSocket50AU"} } diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/init.lua index 981a4b5400..b1d10f94a6 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-dual-metering-switch/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local st_device = require "st.device" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/can_handle.lua index 56106764b6..e6e3165aa3 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device, ...) local can_handle = device:get_manufacturer() == "DAWON_DNS" if can_handle then diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua index 7da5a400c7..17dc0ee2bd 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-metering-plug-power-consumption-report/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local clusters = require "st.zigbee.zcl.clusters" local capabilities = require "st.capabilities" diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/can_handle.lua index ee01893636..18cff448c1 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local AURORA_RELAY_FINGERPRINTS = { diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua index 42fa53e407..266ff9b4e7 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/aurora-relay/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local constants = require "st.zigbee.constants" diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/can_handle.lua index 788e0362ec..ed4db3dc52 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local SWITCH_POWER_FINGERPRINTS = require "zigbee-switch-power.fingerprints" for _, fingerprint in ipairs(SWITCH_POWER_FINGERPRINTS) do diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/fingerprints.lua index 902b7e4937..d277d36967 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { { mfr = "Vimar", model = "Mains_Power_Outlet_v1.0" }, { model = "PAN18-v1.0.7" }, diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/init.lua index 9a32274d0a..0ea2224a6f 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/sub_drivers.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/sub_drivers.lua index b9c6316ba8..340e1f27c6 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/sub_drivers.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/sub_drivers.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + local lazy_load = require "lazy_load_subdriver" return { diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/can_handle.lua index 8580ce38a8..8143fb6a8e 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local VIMAR_FINGERPRINTS = { diff --git a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua index 3a4c73d94a..82eb0674d4 100644 --- a/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zigbee-switch-power/vimar/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local constants = require "st.zigbee.constants" local device_management = require "st.zigbee.device_management" diff --git a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/can_handle.lua index 354cd3bf9f..f2de6f2d81 100644 --- a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device) local ZLL_DIMMER_BULB_FINGERPRINTS = require "zll-dimmer-bulb.fingerprints" local can_handle = (ZLL_DIMMER_BULB_FINGERPRINTS[device:get_manufacturer()] or {})[device:get_model()] diff --git a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/fingerprints.lua b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/fingerprints.lua index 9ff7bb0618..ab13464d62 100644 --- a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/fingerprints.lua +++ b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/fingerprints.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return { ["AduroSmart Eria"] = { ["ZLL-DimmableLight"] = true, diff --git a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/init.lua b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/init.lua index 2347345f49..d6becf1467 100644 --- a/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zll-dimmer-bulb/init.lua @@ -1,16 +1,5 @@ --- 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local capabilities = require "st.capabilities" local clusters = require "st.zigbee.zcl.clusters" diff --git a/drivers/SmartThings/zigbee-switch/src/zll-polling/can_handle.lua b/drivers/SmartThings/zigbee-switch/src/zll-polling/can_handle.lua index 3ddd9b8328..c39ee387e3 100644 --- a/drivers/SmartThings/zigbee-switch/src/zll-polling/can_handle.lua +++ b/drivers/SmartThings/zigbee-switch/src/zll-polling/can_handle.lua @@ -1,3 +1,6 @@ +-- Copyright 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 + return function(opts, driver, device, zb_rx, ...) local constants = require "st.zigbee.constants" diff --git a/drivers/SmartThings/zigbee-switch/src/zll-polling/init.lua b/drivers/SmartThings/zigbee-switch/src/zll-polling/init.lua index ad619e070e..3478b39bd5 100644 --- a/drivers/SmartThings/zigbee-switch/src/zll-polling/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/zll-polling/init.lua @@ -1,16 +1,5 @@ --- Copyright 2025 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 2025 SmartThings, Inc. +-- Licensed under the Apache License, Version 2.0 local device_lib = require "st.device" local clusters = require "st.zigbee.zcl.clusters"