Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matter Switch: Support Fan/Light device #2032

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nickolas-deboom
Copy link
Contributor

@nickolas-deboom nickolas-deboom commented Mar 28, 2025

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

This change adds a new profile for a fan+color light device, brings in handlers for fan attributes and capabilities, and adds new logic to select the new profile and create the component map.

Summary of Completed Tests

Tested with an Orein fan.

Copy link

Copy link

github-actions bot commented Mar 28, 2025

Test Results

   66 files    421 suites   0s ⏱️
2 167 tests 2 167 ✅ 0 💤 0 ❌
3 689 runs  3 689 ✅ 0 💤 0 ❌

Results for commit f1c5164.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Mar 28, 2025

File Coverage
All files 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/embedded-cluster-utils.lua 38%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/eve-energy/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/aqara-cube/init.lua 96%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against f1c5164

This change adds a new profile for a fan+color light device,
brings in handlers for fan attributes and capabilities, and
adds new logic to select the new profile and create the
component map.
@nickolas-deboom nickolas-deboom force-pushed the matter-switch-support-fan-light branch from 8b8df76 to feeaad8 Compare April 1, 2025 14:19
@hcarter-775
Copy link
Contributor

hcarter-775 commented Apr 9, 2025

Can you do an onboarding test of a light-button device as well? Also, one with a multi-button device? Just trying to hit all the affected paths. We should also test a parent-child switch device since the handling for their creation was moved.

if ep ~= main_endpoint then
local button_component = "button" .. component_num
component_map[button_component] = ep
local function build_component_map(device, main_endpoint, endpoints)
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need to send the endpoints in as a parameter anymore. Let's just set an endpoints variable in the if-else check whether to use button or fan components.

if #button_eps > 0 then
build_button_profile(device, main_endpoint, #button_eps)
build_mcd_profile(device, main_endpoint)
build_component_map(device, main_endpoint, button_eps)
Copy link
Contributor

@hcarter-775 hcarter-775 Apr 9, 2025

Choose a reason for hiding this comment

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

We don't need this if #button_eps > 0 and #fan_eps > 0 check here, since the same logic is handled within the build_mcd_profile and build_component_map function.

Copy link
Contributor

@hcarter-775 hcarter-775 Apr 9, 2025

Choose a reason for hiding this comment

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

By that thinking, we also don't need the fan_eps or button_eps get_endpoints calls here.

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