Skip to content

Hager rotary dimmer implementation - #3215

Open
JanJakubiszyn wants to merge 1 commit into
SmartThingsCommunity:mainfrom
JanJakubiszyn:Hager_waasys_rotrary_dim
Open

Hager rotary dimmer implementation#3215
JanJakubiszyn wants to merge 1 commit into
SmartThingsCommunity:mainfrom
JanJakubiszyn:Hager_waasys_rotrary_dim

Conversation

@JanJakubiszyn

Copy link
Copy Markdown
Contributor

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Adding rotary dimmer device support for Hager.

Summary of Completed Tests

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

matter-switch_coverage.xml

File Coverage
All files 85%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/capability_handlers.lua 36%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua 80%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_handlers/event_handlers.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/utils.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_garage_door/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_utils/event_utils.lua 52%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/third_reality_mk1/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/eve_energy/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/attribute_handlers.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_handlers/capability_handlers.lua 10%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/init.lua 90%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/hager/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/utils.lua 99%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/camera_utils/device_configuration.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/aqara_cube/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/ikea_scroll/scroll_handlers/event_handlers.lua 75%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/sub_drivers/camera/init.lua 97%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against c19f612

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Test Results

   73 files  ±0    541 suites  ±0   0s ⏱️ ±0s
3 272 tests +7  2 827 ✅  - 438  0 💤 ±0  0 ❌ ±0  445 🔥 +445 
5 261 runs  +7  4 672 ✅  - 582  0 💤 ±0  0 ❌ ±0  589 🔥 +589 

For more details on these errors, see this check.

Results for commit c19f612. ± Comparison against base commit 71bbd3d.

♻️ This comment has been updated with latest results.

device:send(cluster_base.subscribe(device, endpoint_id, cluster_id, attr_id, event_id))
end

local function is_standalone_device (device)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what does this function imply?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This function is created to separate standalone devices which are from WAASYS series but do not utilize the matter bridge device type. They differ in the endpoint architecture and have to be handled in a different way but they also support manually set functions like adding a child device responsible for remote light control.

This function allows to determine this type of device and eliminate/include them the driver behavior.

for example, standalone devices do not require mapping done in the info_changed function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So you are saying that these are just devices from Hager, rather than bridged devices from the Hager Bridge? I am curious, but I also think this would be a worthwhile thing to explain in a comment, since is_standalone does not express a lot (in my opinion) about what is being checked, especially when the internals are extremely device specific.

I also suggest that you add some commentary in the function itself to explain what is being checked, since the endpoint id checks are not understandable without Hager-specific context.

@JanJakubiszyn JanJakubiszyn Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, they are just simple Hager devices without the bridge functionality.

I will change the function name to "is_non_bridge_type" and add comments for better clarity
and understanding of the architectural differences between them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I'd maybe just check then if the device is 1. an Aggregator device type and 2. is a Matter (not EDGE child) device? Or something like that. If it isn't, then we'd know it is a non-bridge Matter device. I am not sure we need this extremely specific endpoint checking to know whether it is a regular device or not

@JanJakubiszyn
JanJakubiszyn force-pushed the Hager_waasys_rotrary_dim branch from b9d4915 to c19f612 Compare September 9, 2026 13:02
local value = ib.data.elements
local reports_dimmable = false

for _, element in ipairs(value) do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
for _, element in ipairs(value) do
for _, element in ipairs(value or {}) do

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.

2 participants