Shared Device Capabilities (Special Case)#
This directory contains shared functional baselines (OnOffLoad,
DimmableLoad, FanLoad) and reusable delegate implementations
(impl/Logging*Delegate.h).
Overview & Inheritance Chain#
Unlike device/types/, which maps directly to spec-defined Matter Device Types
(e.g., Dimmable Light or Extractor Hood), capabilities are internal
abstractions shared by a few closely related load families:
impl/LoggingOnOffLight -> OnOffLight (Device Type) -> OnOffLoad (Capability) -> SingleEndpoint
on-off-load(OnOffLoad): Shared OnOff, Identify, Groups, and ScenesManagement wiring.dimmable-load(DimmableLoad): Adds LevelControl transitions on top of OnOff/Identify/Scenes/Groups.fan-load(FanLoad): Shared FanControl, Identify, Groups, and optional OnOff wiring.
Architectural Guidelines (When NOT to Use Capabilities)#
Capabilities Are a Special Case, Not the Default: New device types in
device/types/should inherit directly fromSingleEndpoint, not from a capability class. Deep inheritance chains couple unrelated device types, complicate constructor/context plumbing, and make cluster lifecycles harder to follow.Prefer Explicit Cluster Declarations over Endpoint Base Classes: Duplicating a few
LazyRegisteredServerClustermember declarations across device types is simpler and more maintainable than introducing a shared capability base class.Share Delegate Implementations, Not Endpoint Bases: When sharing cluster behavior or logging stubs across multiple device types, place reusable delegate classes in
capabilities/<name>/impl/(e.g.,LoggingOnOffDelegate,LoggingDimmableDelegate) and inherit/compose those delegates insidedevice/types/<foo>/impl/LoggingFoo.No Sibling Dependencies: Files in
device/capabilities/must compile independently of concrete device types indevice/types/. They may depend ondevice/api/and shared Matter cluster or data-model APIs.