Aqara Wireless Knob Switch H1#2844
Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Channel deleted. |
Test Results 72 files 495 suites 0s ⏱️ Results for commit a56dcd1. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against a56dcd1 |
| @@ -0,0 +1,149 @@ | |||
| -- Copyright 2024 SmartThings | |||
There was a problem hiding this comment.
Fixed the copyright year. Thanks for the review!
cjswedes
left a comment
There was a problem hiding this comment.
Looks pretty good. Just a few small optimizations and a couple extra tests requested to be added.
drivers/SmartThings/zigbee-button/profiles/aqara-knob-switch.yml
Outdated
Show resolved
Hide resolved
|
|
||
| local function do_configure(driver, device) | ||
| device:configure() | ||
| device:send(cluster_base.write_manufacturer_specific_attribute(device, |
There was a problem hiding this comment.
nit: a comment here about what this attribute write is doing would be nice to understand why it is needed.
| local sensitivity = tonumber(device.preferences[SENSITIVITY_KEY]) | ||
| local factor = SENSITIVITY_FACTORS[sensitivity] or 1.0 | ||
| local intermediate_val = raw_val * factor | ||
| local sign = (intermediate_val > 0 and 1) or (intermediate_val < 0 and -1) or 0 |
|
Also, just a reminder to ensure the luacheck passes (removing whitespace, unused variables, etc) before merging. Thanks! |
| device:emit_event(capabilities.knob.rotateAmount({value = 0, unit = "%"})) | ||
| device:emit_event(capabilities.knob.heldRotateAmount({value = 0, unit = "%"})) |
There was a problem hiding this comment.
| device:emit_event(capabilities.knob.rotateAmount({value = 0, unit = "%"})) | |
| device:emit_event(capabilities.knob.heldRotateAmount({value = 0, unit = "%"})) | |
| device:emit_event(capabilities.knob.rotateAmount(0)) | |
| device:emit_event(capabilities.knob.heldRotateAmount(0)) |
nit: The rotate attributes do not support a unit in their arguments. The command passes through fine but the unit does not actually pass into anything. This can be extended to all uses of these attributes.
|
Thank you @cjswedes and @hcarter-775 for the detailed review! I have updated the code to:
The tests have also been updated to reflect these changes. |
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests