Skip to content

Conversation

@janbajc
Copy link
Contributor

@janbajc janbajc commented Oct 13, 2025

Check all that apply

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

Summary of Completed Tests

@github-actions
Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions
Copy link

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

Test Results

   71 files    465 suites   0s ⏱️
2 416 tests 2 416 ✅ 0 💤 0 ❌
4 103 runs  4 103 ✅ 0 💤 0 ❌

Results for commit cdcc09d.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

File Coverage
All files 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/fibaro-flood-sensor/init.lua 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/apiv6_bugfix/init.lua 77%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/aeotec-multisensor/multisensor-6/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/enerwave-motion-sensor/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/aeotec-multisensor/multisensor-7/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/aeotec-multisensor/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/sensative-strip/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/shelly-wave-door-window-sensor/init.lua 56%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/homeseer-multi-sensor/init.lua 95%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/wakeup-no-poll/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-sensor/src/zooz-4-in-1-sensor/init.lua 98%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against cdcc09d

@greens greens changed the title Add shelly wave door-window driver WWSTCERT-8745 Add shelly wave door-window driver Nov 4, 2025
Copy link
Contributor

@wkhenon wkhenon left a 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

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Comment on lines +32 to +39
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
Copy link
Contributor

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 = "%"}))
Copy link
Contributor

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 = "%"}))
Copy link
Contributor

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.

Copy link
Contributor

@greens greens left a 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.

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.

3 participants