-
Notifications
You must be signed in to change notification settings - Fork 521
Matter Switch: Add switch-fan profile #2514
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
base: main
Are you sure you want to change the base?
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Invitation URL: |
Test Results 71 files 477 suites 0s ⏱️ Results for commit 3207196. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 3207196 |
2aa9869 to
a809b47
Compare
28a9a6d to
73edaae
Compare
| - id: refresh | ||
| version: 1 | ||
| categories: | ||
| - name: Switch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using the Switch if this could also be a light? Just want to make sure we don't get pinged about this later. And why not use Fan instead?
73edaae to
3207196
Compare
ctowns
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's have a discussion offline about the category selection, but that can also be changed later if needed.
| updated_profile = SwitchDeviceConfiguration.assign_profile_for_onoff_ep(device, default_endpoint_id) | ||
| local generic_profile = function(s) return string.find(updated_profile or "", s, 1, true) end | ||
| if generic_profile("light-color-level") and #device:get_endpoints(clusters.FanControl.ID) > 0 then | ||
| if (generic_profile("plug-binary") or generic_profile("light-binary")) and #device:get_endpoints(clusters.FanControl.ID) > 0 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to Cooper's comment, should we split this up and have a separate light-fan profile with the Light category?
Description of Change
Add new profile. Generically choose it always whether the device is a plug or a light binary device.
Summary of Completed Tests
Added a test case to show correct update logic.