Skip to content

Conversation

@aleclorimer
Copy link
Contributor

Lazy loading of the zigbee-motion-sensor sub drivers with the can_handle lazy loading.

This driver was modified heavily by the use of a script I've been developing to automate this process for the rest of the zigbee, zwave and matter drivers. This is the first PR & driver refactored with the assistance of the script (though still massaged to pass all driver tests by me).

@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Test Results

   71 files    466 suites   0s ⏱️
2 416 tests 2 416 ✅ 0 💤 0 ❌
4 116 runs  4 116 ✅ 0 💤 0 ❌

Results for commit 993cfb0.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

File Coverage
All files 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-motion-sensor/src/ikea/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-motion-sensor/src/aqara/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-motion-sensor/src/aqara/aqara_utils.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-motion-sensor/src/frient/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-motion-sensor/src/gatorsystem/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-motion-sensor/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-motion-sensor/src/init.lua 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-motion-sensor/src/thirdreality/init.lua 93%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 993cfb0

@aleclorimer aleclorimer force-pushed the task/zigbee-motion-sensor-lazy-load-subdrivers branch from 0ae4dbb to 993cfb0 Compare November 13, 2025 20:18
Copy link
Contributor

@cjswedes cjswedes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a few formatting nits that are nice to have. Did the test suite get run against 0.58 lua libs? CI is now running 0.59 lua libs, and we need to check that 58 doesnt have failing tests related to this.

@@ -0,0 +1,9 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra newline

{ mfr = "AduroSmart Eria", model = "VMS_ADUROLIGHT" }
}

return DEVICES_REPORTING_BATTERY_VOLTAGE No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: newline at end of file

-- Licensed under the Apache License, Version 2.0

local function centralite_can_handle(opts, driver, device, ...)
if device:get_manufacturer() == "CentraLite" then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation


local function gatorsystem_can_handle(opts, driver, device, ...)
if device:get_manufacturer() == "GatorSystem" and device:get_model() == "GSHW01" then
return true, require("gatorsystem")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation

-- Licensed under the Apache License, Version 2.0

local function samjin_can_handle(opts, driver, device, ...)
if device:get_manufacturer() == "Samjin" then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation

-- Licensed under the Apache License, Version 2.0

local function smartthings_can_handle(opts, driver, device, ...)
if device:get_manufacturer() == "SmartThings" then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation

Copy link
Contributor

@greens greens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're touching all of these files, would it be possible to replace the existing copyright/license statement with the shorter one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants