-
Notifications
You must be signed in to change notification settings - Fork 517
WWSTCERT-8745 Add shelly wave door-window driver #2460
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
Co-authored-by: Steven Green <[email protected]>
|
Duplicate profile check: Passed - no duplicate profiles detected. |
|
Invitation URL: |
Test Results 71 files 465 suites 0s ⏱️ Results for commit cdcc09d. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against cdcc09d |
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.
Unit tests for new profile
| productType: 0x0100 | ||
| productId: 0x0081 | ||
| deviceProfileName: shelly-wave-door-window-sensor | ||
|
|
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.
| local function can_handle_wave_door_window_sensor(opts, driver, device, ...) | ||
| for _, fingerprint in ipairs(WAVE_DOOR_WINDOW_SENSOR_FINGERPRINTS) do | ||
| if device:id_match(fingerprint.manufacturerId, fingerprint.productType, fingerprint.productId) then | ||
| return true | ||
| end | ||
| end | ||
| return false | ||
| end |
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.
For our drivers that use lazy_load_if_possible the return values of the can_handle function need to be a little different.
For an example: https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/blob/main/drivers/SmartThings/zwave-sensor/src/sensative-strip/init.lua#L29
| if cmd.args.sensor_type == SensorMultilevel.sensor_type.LUMINANCE then | ||
| device:emit_event(capabilities.illuminanceMeasurement.illuminance({value = cmd.args.sensor_value, unit = "lux"})) | ||
| elseif cmd.args.sensor_type == SensorMultilevel.sensor_type.DIRECTION then | ||
| device:emit_event(capabilities.relativeHumidityMeasurement.humidity({value = cmd.args.sensor_value, unit = "%"})) |
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.
nit: spacing
| if cmd.args.sensor_type == SensorMultilevel.sensor_type.LUMINANCE then | ||
| device:emit_event(capabilities.illuminanceMeasurement.illuminance({value = cmd.args.sensor_value, unit = "lux"})) | ||
| elseif cmd.args.sensor_type == SensorMultilevel.sensor_type.DIRECTION then | ||
| device:emit_event(capabilities.relativeHumidityMeasurement.humidity({value = cmd.args.sensor_value, unit = "%"})) |
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.
The profile you've specified doesn't include relativeHumidityMeasurement. This event will never be seen with the current profile. It should either be removed, which means you can just use the default handling, or you need to add relativeHumidityMeasurement to your profile.
greens
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.
Please include unit tests.
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests