Skip to content

Commit 40b41de

Browse files
authored
Tweak AI instructions to clarify when test coverage isn't needed (#4762)
1 parent 2b3e53f commit 40b41de

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/copilot-instructions.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,23 @@ def test_my_device_signature(assert_signature_matches_quirk):
460460
assert_signature_matches_quirk(MyDeviceQuirk, signature)
461461
```
462462

463+
**When tests are NOT needed:** Purely declarative v2 quirks that contain no custom logic do not require test coverage. This includes quirks that only use existing custom clusters (already tested elsewhere), `.device_automation_triggers()`, `.friendly_name()`, `.applies_to()`, `.skip_configuration()`, or other pure definitions. Example:
464+
465+
```python
466+
(
467+
QuirkBuilder("Manufacturer", "Model")
468+
.friendly_name(model="Wireless Mini Switch", manufacturer="Acme")
469+
.replaces(ExistingCustomCluster)
470+
.device_automation_triggers({
471+
(SHORT_PRESS, BUTTON): {COMMAND: COMMAND_1_SINGLE},
472+
(DOUBLE_PRESS, BUTTON): {COMMAND: COMMAND_1_DOUBLE},
473+
})
474+
.add_to_registry()
475+
)
476+
```
477+
478+
Tests **are** needed when a quirk introduces custom logic such as custom clusters with overridden methods (e.g., `handle_cluster_request`, `update_attribute`), `attribute_converter` lambdas, or custom filter functions.
479+
463480
## Code Organization
464481

465482
Quirks are organized by manufacturer in `zhaquirks/<manufacturer>/`:

0 commit comments

Comments
 (0)