Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4782 +/- ##
==========================================
+ Coverage 92.35% 92.67% +0.31%
==========================================
Files 371 381 +10
Lines 12234 12789 +555
==========================================
+ Hits 11299 11852 +553
- Misses 935 937 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new ZHA quirk for the ELECRAM “Ramses_esp32c6” device to support its custom RX/TX Zigbee clusters, along with initial test coverage to validate the quirk signature and cluster wiring.
Changes:
- Added
RamsesESPv1 quirk and two custom clusters (RamsesRXCluster,RamsesTXCluster) using manufacturer-specific cluster IDs. - Introduced the
zhaquirks.elecrampackage. - Added tests validating signature matching, cluster replacement, and command definitions.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| zhaquirks/elecram/ramses_esp.py | Implements the ELECRAM Ramses ESP quirk and custom clusters. |
| zhaquirks/elecram/init.py | Adds the new manufacturer package initializer. |
| tests/test_elecram.py | Adds tests for signature matching, cluster replacement, and command IDs. |
zhaquirks/elecram/__init__.py
Outdated
| @@ -0,0 +1 @@ | |||
| """Module for Aurora devices.""" | |||
There was a problem hiding this comment.
The package docstring appears to be copy/pasted from zhaquirks/aurora (it says "Aurora devices"), which is misleading for the new elecram quirks package. Please update it to describe ELECRAM/Elecram devices (or RAMSES ESP specifically).
| """Module for Aurora devices.""" | |
| """Quirks for Elecram (ELECRAM) devices, including RAMSES ESP-based hardware.""" |
tests/test_elecram.py
Outdated
| """Tests for the ELECRAM RAMSES ESP32-C6 quirk.""" | ||
|
|
||
| import zhaquirks | ||
| import zhaquirks.elecram.ramses_esp |
There was a problem hiding this comment.
tests/test_elecram.py imports zhaquirks.elecram.ramses_esp but never uses that name, and the subsequent from zhaquirks.elecram.ramses_esp import ... already imports the module. This will trigger Ruff F401 (unused import). Remove the redundant import zhaquirks.elecram.ramses_esp line (or reference it explicitly if you really need the side effect).
| import zhaquirks.elecram.ramses_esp |
| 10: { | ||
| PROFILE_ID: zha.PROFILE_ID, # Home Automation | ||
| INPUT_CLUSTERS: [ | ||
| Basic.cluster_id, # 0x0000 | ||
| Identify.cluster_id, # 0x0003 | ||
| RAMSES_TX_CLUSTER, # Ramses TX Cluster (server - receives commands from ZHA) | ||
| ], |
There was a problem hiding this comment.
The quirk signature endpoint definition omits DEVICE_TYPE. In this codebase, v1 quirks typically include DEVICE_TYPE for each endpoint (e.g., zhaquirks/texasinstruments/router.py:38-48, zhaquirks/aurora/aurora_dimmer.py:75-83). Consider adding the device type from diagnostics (your test signature shows 0x0000) to make matching more specific and keep endpoint metadata consistent.
| 10: { | ||
| PROFILE_ID: zha.PROFILE_ID, | ||
| INPUT_CLUSTERS: [ | ||
| Basic.cluster_id, | ||
| Identify.cluster_id, | ||
| RamsesTXCluster, | ||
| ], |
There was a problem hiding this comment.
The replacement endpoint definition also omits DEVICE_TYPE. If the original device type is important for ZHA entity creation/metadata, leaving it out can lead to inconsistent behavior. Add DEVICE_TYPE here as well (matching the device’s actual type from diagnostics) to align with other v1 quirks.
|
A few questions:
|
|
Proposed change
For the project ramses_cc I am working on Zigbee communication for my Ramses ESP board. Until now, only serial and MQTT communication was possible.
Additional information
The device supports two custom clusters, in similar fashion as the MQTT communication. One cluster is for sending received messages to Ramses RF, the other for receiving messages from Ramses RF.
Device diagnostics
diagnostics.txt
Checklist
[x] The changes are tested and work correctly
[x] pre-commit checks pass / the code has been formatted using Black
[x] Tests have been added to verify that the new code works
[x] Device diagnostics data has been attached