Skip to content

Add Doorbell device type to all-devices app. - #74027

Open
tersal wants to merge 12 commits into
project-chip:masterfrom
tersal:add-doorbell-device
Open

Add Doorbell device type to all-devices app.#74027
tersal wants to merge 12 commits into
project-chip:masterfrom
tersal:add-doorbell-device

Conversation

@tersal

@tersal tersal commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adding the Doorbell device type to all-devices app, this cluster includes the Identify, Switch and Bindings cluster, this last one because this device has a Chime cluster as a client.

Related issues

NA

Testing

Manually tested to confirm that the clusters are added and the client list contains Chime, actual communication between clusters is pending.

Copilot AI lite review requested due to automatic review settings September 9, 2026 04:29
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files. (8 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: adding the Doorbell device type to the all-devices app.
Description check ✅ Passed The description directly describes the Doorbell device type, its included clusters, the Chime client relationship, and the current testing status.
Full details: Docstring Coverage

Explanation

Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 4 files. (8 skipped: 8 unsupported.)

  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tersal tersal changed the title Add doorbell device Add Doorbell device type to all-devices app. Sep 9, 2026

Copilot AI left a comment

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.

🟡 Changes recommended

Doorbell endpoint registration currently lacks the standard rollback/transaction pattern used by other device types, which can leave partially-registered clusters/endpoints on failure.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new Doorbell device type to the all-devices-app and wires it into the device-factory/build target lists so it can be enabled and instantiated like other device types.

Changes:

  • Add doorbell to the build target/device enablement registries (GN + CMake + build scripts).
  • Introduce a new Doorbell SingleEndpoint device implementation (Identify, Switch, Binding; Chime as a client cluster).
  • Register the new device type in DeviceFactory so it can be created by name.
File summaries
File Description
scripts/build/build/targets.py Adds doorbell to the selectable build targets list.
examples/all-devices-app/all-devices-common/device/types/doorbell/Doorbell.h Declares the new Doorbell device type (SingleEndpoint) and its clusters.
examples/all-devices-app/all-devices-common/device/types/doorbell/Doorbell.cpp Implements endpoint/cluster registration and client cluster list for Doorbell.
examples/all-devices-app/all-devices-common/device/types/doorbell/BUILD.gn Introduces GN target for building the new Doorbell device type sources.
examples/all-devices-app/all-devices-common/device-factory/enabled_devices.gni Adds doorbell to the GN-enabled device registry.
examples/all-devices-app/all-devices-common/device-factory/enabled_devices.cmake Adds doorbell to the CMake-enabled device registry.
examples/all-devices-app/all-devices-common/device-factory/enabled_devices_config.h.in Adds ALL_DEVICES_ENABLE_DOORBELL config define.
examples/all-devices-app/all-devices-common/device-factory/DeviceFactory.h Registers a creator for the doorbell device string key.
examples/all-devices-app/all-devices-common/device-factory/BUILD.gn Ensures device-factory depends on the new Doorbell GN target.
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread examples/all-devices-app/all-devices-common/device/types/doorbell/Doorbell.cpp Outdated
Copilot AI review requested due to automatic review settings September 9, 2026 04:34

Copilot AI left a comment

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.

🔵 Needs a closer look

Doorbell registration currently lacks the standard rollback guard (and has an ambiguous Switch startup config), which can leave partially-registered state on early errors.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

examples/all-devices-app/all-devices-common/device/types/doorbell/Doorbell.cpp:58

  • Doorbell::Register() does not use DeviceRegistrationTransaction, so any early-return error (e.g. AddCluster/AddEndpoint failure) will leave partially-registered clusters/descriptor state in the provider instead of rolling back via Unregister(). Also, SwitchCluster::StartupConfiguration is initialized positionally as { 2, 2 }, which implicitly sets multiPressMax even though the feature map does not enable multi-press; use named initialization to avoid accidental field-order/feature mismatches.

examples/all-devices-app/all-devices-common/device/types/doorbell/Doorbell.cpp:4

  • The copyright header year in this new source file is 2025, but the matching header (Doorbell.h) and the rest of the new Doorbell device type changes are 2026. Please make the year consistent.
/*
 *
 *    Copyright (c) 2025 Project CHIP Authors
 *
  • Files reviewed: 9/9 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 9, 2026 17:01

Copilot AI left a comment

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.

🟡 Changes recommended

The new Doorbell device type unnecessarily depends on the Chime server cluster via includes/deps (rather than including the generated Chime IDs directly), which increases build/link surface and is avoidable.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

examples/all-devices-app/all-devices-common/device/types/doorbell/Doorbell.h:23

  • Doorbell.h includes app/clusters/chime-server/ChimeCluster.h, but this header does not reference any Chime server symbols (it only needs Chime::Id in the .cpp). Keeping this include pulls in unnecessary server-cluster dependencies and makes Doorbell.cpp rely on a transitive include for the cluster ID.
  • Files reviewed: 12/12 changed files
  • Comments generated: 2
  • Review effort level: Lite

@mergify mergify Bot added the conflict label Sep 9, 2026
Copilot AI review requested due to automatic review settings September 9, 2026 17:48

Copilot AI left a comment

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.

🟡 Changes recommended

The new Doorbell header introduces an unnecessary chime-server include that can break strict include/dependency checking and should be removed or properly depended on.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 9, 2026 17:52
@mergify mergify Bot removed the conflict label Sep 9, 2026

Copilot AI left a comment

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.

🟡 Changes recommended

The CMake-enabled device list adds doorbell but does not add Doorbell.cpp to the compiled device sources list, which can break ESP32/Telink all-devices builds when all devices are enabled.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

examples/all-devices-app/all-devices-common/device/types/doorbell/Doorbell.h:23

  • Doorbell.h includes the Chime server cluster header, but the doorbell device only uses the Chime cluster ID as a client (and does not reference ChimeCluster types). Keeping this include adds an unnecessary dependency surface and can break strict include/deps checking.
#include <app/clusters/bindings/BindingCluster.h>
#include <app/clusters/bindings/BindingManager.h>
#include <app/clusters/bindings/binding-table.h>
#include <app/clusters/chime-server/ChimeCluster.h>
#include <app/clusters/identify-server/IdentifyCluster.h>
  • Files reviewed: 12/12 changed files
  • Comments generated: 1
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 9, 2026 18:02

Copilot AI left a comment

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.

🟢 Approval recommended

The new Doorbell device type is consistently integrated across the all-devices build/enablement pipeline and follows existing SingleEndpoint registration/unregistration patterns.

Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.40%. Comparing base (05ad181) to head (d12a40a).
⚠️ Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
...-devices-common/device/types/doorbell/Doorbell.cpp 0.00% 44 Missing ⚠️
.../all-devices-common/device-factory/DeviceFactory.h 0.00% 4 Missing ⚠️
...ll-devices-common/device/types/doorbell/Doorbell.h 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #74027      +/-   ##
==========================================
- Coverage   57.42%   57.40%   -0.03%     
==========================================
  Files        1940     1942       +2     
  Lines      127709   127758      +49     
  Branches    14502    14518      +16     
==========================================
- Hits        73336    73335       -1     
- Misses      54373    54423      +50     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tersal
tersal marked this pull request as ready for review September 10, 2026 15:02
@pullapprove
pullapprove Bot requested a review from andy31415 September 10, 2026 15:02
@mergify mergify Bot added the conflict label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants