Skip to content

[WWSTCERT-13550] Sonoff - Add the pressure display function to SNZB-02M - #3194

Open
laity-w-sudo wants to merge 5 commits into
SmartThingsCommunity:mainfrom
laity-w-sudo:main
Open

[WWSTCERT-13550] Sonoff - Add the pressure display function to SNZB-02M#3194
laity-w-sudo wants to merge 5 commits into
SmartThingsCommunity:mainfrom
laity-w-sudo:main

Conversation

@laity-w-sudo

@laity-w-sudo laity-w-sudo commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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

Adding the air pressure function to the SNZB-02M equipment

Summary of Completed Tests

@github-actions

Copy link
Copy Markdown

Duplicate profile check: Passed - no duplicate profiles detected.

@github-actions

Copy link
Copy Markdown

Profile category check: ✅ Passed - all profiles have a category defined.

@github-actions

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Test Results

 1 files  12 suites   0s ⏱️
25 tests 25 ✅ 0 💤 0 ❌
63 runs  63 ✅ 0 💤 0 ❌

Results for commit 1ca26b1.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

zigbee-humidity-sensor_coverage.xml

File Coverage
All files 98%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-humidity-sensor/src/lazy_load_subdriver.lua 57%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-humidity-sensor/src/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-humidity-sensor/src/sonoff/SNZB-02M/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-humidity-sensor/src/plant-link/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zigbee-humidity-sensor/src/frient-sensor/air-quality/init.lua 98%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 1ca26b1

The SNZB-02M sub-driver was added but never registered, so the
pressure display feature was dead code on the device. Register it
via sub_drivers.lua, drop the unrelated SNZB-02LD/WD handler and
utils (not in this driver, and referencing a nonexistent sub-driver),
and add unit tests for pressure conversion and refresh.

Co-Authored-By: Claude <noreply@anthropic.com>
@laity-w-sudo
laity-w-sudo force-pushed the main branch 2 times, most recently from ae161d5 to b5e3665 Compare August 25, 2026 11:23
@@ -0,0 +1,12 @@
-- Copyright 2025 SmartThings, Inc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
-- Copyright 2025 SmartThings, Inc.
-- Copyright 2026 SmartThings, Inc.

Comment on lines +1 to +5
--[[
Description: SNZB-02M pressure/humidity/temperature sensor driver
Version: 1.0
Author: GitHub Copilot
--]]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
--[[
Description: SNZB-02M pressure/humidity/temperature sensor driver
Version: 1.0
Author: GitHub Copilot
--]]
-- Copyright 2026 SmartThings, Inc.
-- Licensed under the Apache License, Version 2.0

Comment on lines +16 to +18
if raw_value > 2000 then
return raw_value / 1000.0
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please, could You add short explanation (in a comment) above this "if" statement regarding the edge case that forces this division ?

Comment on lines +13 to +14
if CHANGED_DRIVERS:
DRIVERS = [driver for driver in DRIVERS if driver.name in CHANGED_DRIVERS]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change is not directly related to Your device.

@KKlimczukS
KKlimczukS requested a review from cbaumler August 31, 2026 09:20
@KKlimczukS KKlimczukS changed the title Add the pressure display function to SNZB-02M [WWSTCERT-13550] Sonoff - Add the pressure display function to SNZB-02M Aug 31, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove the changes to this file.

- id: refresh
version: 1
categories:
- name: MultiFunctionalSensor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
- name: MultiFunctionalSensor
- name: HumiditySensor

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.

4 participants