-
Notifications
You must be signed in to change notification settings - Fork 513
Add processing logic of motion sensor in button devices #2459
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?
Add processing logic of motion sensor in button devices #2459
Conversation
Duplicate profile check: Passed - no duplicate profiles detected. |
Invitation URL: |
Test Results 71 files 456 suites 0s ⏱️ Results for commit 3601470. ♻️ This comment has been updated with latest results. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against 3601470 |
@nickolas-deboom @hcarter-775 We closed the previous PR (#2422) and moved here. Please check the modification, thank you! |
end | ||
local motion_eps = device:get_endpoints(clusters.OccupancySensing.ID) | ||
if #motion_eps > 0 then | ||
profile_name = profile_name .. "-motion" |
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.
this may misprofile button devices that have this format but are not configured with 3 or 6 buttons. Please add a check here of something like if #motion_eps > 0 and (num_button_eps == 3 or num_button_eps == 6) then
Check all that apply
Type of Change
Checklist
Description of Change
The modification originated from this PR (#2422). Considering that there was a big code refactoring, we closed the previous submission and proposed this new PR.
In the past, the button devices with motion sensor did not support their complete functions. Now add relevant processing logic, so that this kind of devices can display the sensor normally in the plugin.
Summary of Completed Tests
The unit test file is contained in the commit, and all tests can pass. In addition, we have tested it on device and the function was normal.