Skip to content

Split SONOFF SNZB-02DR2 into a dedicated quirk with external sensor entities - #5271

Open
viys wants to merge 13 commits into
zigpy:devfrom
viys:snzb-02dr2
Open

Split SONOFF SNZB-02DR2 into a dedicated quirk with external sensor entities#5271
viys wants to merge 13 commits into
zigpy:devfrom
viys:snzb-02dr2

Conversation

@viys

@viys viys commented Aug 21, 2026

Copy link
Copy Markdown

Proposed change

Add dedicated ZHA support for the SONOFF SNZB-02DR2 temperature and humidity sensor.

The quirk replaces the former shared model match, exposes the sensor controls and configuration reminder, supports minimum/maximum-record resets, and maps remote temperature and humidity readings to the two firmware-defined sensor slots. It includes behavior coverage for quirk registration, entity configuration, packet handling, and remote sensor writes.

Additional information

The remote sensor entities retain their existing attribute and translation identifiers; this change only clarifies their user-facing labels as slots 1 and 2.

Device diagnostics

Diagnostic dump: SONOFF SNZB-02DR2

Checklist

  • The changes are tested by the included behavior tests
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify the new behavior
  • Device diagnostics data has been attached

Full pre-commit run passed: uv run pre-commit run --all-files.

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.73%. Comparing base (6a3822c) to head (93465c6).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #5271      +/-   ##
==========================================
+ Coverage   92.60%   92.73%   +0.13%     
==========================================
  Files         424      425       +1     
  Lines       14667    14940     +273     
==========================================
+ Hits        13582    13855     +273     
  Misses       1085     1085              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@viys
viys marked this pull request as ready for review August 21, 2026 05:32
@zigpy-review-bot zigpy-review-bot added bot: needs changes PR needs changes per LLM bot: 2.0 migration done PR is on the ZHA/quirks 2.0.0 API (migrated or written for 2.0) per LLM new quirk Adds support for a new device bot: needs maintainer PR does something questionable that needs a maintainer decision per LLM bot: huge PR PR is quite large and should possibly be split up per LLM labels Aug 21, 2026
@zigpy-review-bot zigpy-review-bot changed the title Add SONOFF SNZB-02DR2 sensor support Split SONOFF SNZB-02DR2 into a dedicated quirk with external sensor entities Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot: huge PR PR is quite large and should possibly be split up per LLM bot: needs changes PR needs changes per LLM bot: needs maintainer PR does something questionable that needs a maintainer decision per LLM bot: 2.0 migration done PR is on the ZHA/quirks 2.0.0 API (migrated or written for 2.0) per LLM new quirk Adds support for a new device

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants