Add support for frient/Develco Smart Button (SBTZB-110)#4974
Open
marcintyminski wants to merge 5 commits intozigpy:devfrom
Open
Add support for frient/Develco Smart Button (SBTZB-110)#4974marcintyminski wants to merge 5 commits intozigpy:devfrom
marcintyminski wants to merge 5 commits intozigpy:devfrom
Conversation
Co-authored-by: Copilot <copilot@github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4974 +/- ##
=======================================
Coverage 93.07% 93.08%
=======================================
Files 401 401
Lines 13305 13323 +18
=======================================
+ Hits 12384 12402 +18
Misses 921 921 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Develco/frient Smart Button (SBTZB-110) v2 quirk to expose additional configuration options and adjust how button state is represented in Home Assistant.
Changes:
- Adds a custom
OnOffcluster with manufacturer-specific attributes for button configuration. - Exposes new HA entities for press-action delay (number) and LED color (enum), and changes button state to an enum sensor.
- Adds a dedicated test module asserting the new v2 entity metadata and cluster/enum definitions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
zhaquirks/develco/smart_button.py |
Adds a custom cluster and new v2 entity definitions for button configuration/state, and expands matching to Develco manufacturer string. |
tests/test_develco_smart_button.py |
Adds tests for the new quirk’s v2 entity metadata and basic enum/cluster metadata. |
Comment on lines
51
to
+59
| ( | ||
| QuirkBuilder("frient A/S", "SBTZB-110") | ||
| .applies_to("Develco Products A/S", "SBTZB-110") | ||
| .replaces(CustomOnOff, endpoint_id=32, cluster_type=ClusterType.Client) | ||
| .prevent_default_entity_creation( | ||
| endpoint_id=32, | ||
| cluster_id=OnOff.cluster_id, | ||
| function=lambda entity: entity.device_class == "opening", | ||
| ) |
| class CustomOnOff(CustomCluster, OnOff): | ||
| """Custom OnOff cluster to prevent entity creation.""" | ||
|
|
||
| cluster_id = 0x0006 |
Comment on lines
+28
to
+41
| button_press_blink_led: Final = ZCLAttributeDef( | ||
| id=0x8002, | ||
| type=t.enum8, | ||
| access="rw", | ||
| manufacturer_code=0x1015, | ||
| ) | ||
|
|
||
| class LedColors(t.enum8): | ||
| """LED color options.""" | ||
|
|
||
| OFF = 0 | ||
| RED = 1 | ||
| GREEN = 2 | ||
| YELLOW = 3 |
Comment on lines
+37
to
+40
| assert ("frient A/S", "SBTZB-110") in { | ||
| (metadata.manufacturer, metadata.model) | ||
| for metadata in quirk.manufacturer_model_metadata | ||
| } |
Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
The quirk has been made to extend functionality of the following frient/Develco Smart Buttons:
The quirk contains following changes:
Additional information
Device diagnostics
zha-01KJYXWD9VV3FMNDJEFN115MC4-frient A_S SBTZB-110-1c1b8495e7c58cfb8b38f32b44383248 (4).json
Checklist
pre-commitchecks pass / the code has been formatted using Black