Skip to content

Commit

Permalink
Adds changes for the zap file (project-chip#36761)
Browse files Browse the repository at this point in the history
  • Loading branch information
shgutte authored Dec 9, 2024
1 parent 6447c64 commit 5fe9552
Show file tree
Hide file tree
Showing 4 changed files with 457 additions and 213 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,78 @@ cluster Identify = 3 {
command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64;
}

/** Attributes and commands for switching devices between 'On' and 'Off' states. */
cluster OnOff = 6 {
revision 6;

enum DelayedAllOffEffectVariantEnum : enum8 {
kDelayedOffFastFade = 0;
kNoFade = 1;
kDelayedOffSlowFade = 2;
}

enum DyingLightEffectVariantEnum : enum8 {
kDyingLightFadeOff = 0;
}

enum EffectIdentifierEnum : enum8 {
kDelayedAllOff = 0;
kDyingLight = 1;
}

enum StartUpOnOffEnum : enum8 {
kOff = 0;
kOn = 1;
kToggle = 2;
}

bitmap Feature : bitmap32 {
kLighting = 0x1;
kDeadFrontBehavior = 0x2;
kOffOnly = 0x4;
}

bitmap OnOffControlBitmap : bitmap8 {
kAcceptOnlyWhenOn = 0x1;
}

readonly attribute boolean onOff = 0;
readonly attribute optional boolean globalSceneControl = 16384;
attribute optional int16u onTime = 16385;
attribute optional int16u offWaitTime = 16386;
attribute access(write: manage) optional nullable StartUpOnOffEnum startUpOnOff = 16387;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct OffWithEffectRequest {
EffectIdentifierEnum effectIdentifier = 0;
enum8 effectVariant = 1;
}

request struct OnWithTimedOffRequest {
OnOffControlBitmap onOffControl = 0;
int16u onTime = 1;
int16u offWaitTime = 2;
}

/** On receipt of this command, a device SHALL enter its ‘Off’ state. This state is device dependent, but it is recommended that it is used for power off or similar functions. On receipt of the Off command, the OnTime attribute SHALL be set to 0. */
command Off(): DefaultSuccess = 0;
/** On receipt of this command, a device SHALL enter its ‘On’ state. This state is device dependent, but it is recommended that it is used for power on or similar functions. On receipt of the On command, if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. */
command On(): DefaultSuccess = 1;
/** On receipt of this command, if a device is in its ‘Off’ state it SHALL enter its ‘On’ state. Otherwise, if it is in its ‘On’ state it SHALL enter its ‘Off’ state. On receipt of the Toggle command, if the value of the OnOff attribute is equal to FALSE and if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. If the value of the OnOff attribute is equal to TRUE, the OnTime attribute SHALL be set to 0. */
command Toggle(): DefaultSuccess = 2;
/** The OffWithEffect command allows devices to be turned off using enhanced ways of fading. */
command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64;
/** The OnWithRecallGlobalScene command allows the recall of the settings when the device was turned off. */
command OnWithRecallGlobalScene(): DefaultSuccess = 65;
/** The OnWithTimedOff command allows devices to be turned on for a specific duration with a guarded off duration so that SHOULD the device be subsequently switched off, further OnWithTimedOff commands, received during this time, are prevented from turning the devices back on. */
command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66;
}

/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */
cluster Descriptor = 29 {
revision 2;
Expand Down Expand Up @@ -1643,6 +1715,7 @@ cluster RefrigeratorAlarm = 87 {
endpoint 0 {
device type ma_rootdevice = 22, version 1;

binding cluster OtaSoftwareUpdateProvider;

server cluster Descriptor {
callback attribute deviceTypeList;
Expand Down Expand Up @@ -1704,20 +1777,6 @@ endpoint 0 {
ram attribute clusterRevision default = 3;
}

server cluster OtaSoftwareUpdateProvider {
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

handle command QueryImage;
handle command QueryImageResponse;
handle command ApplyUpdateRequest;
handle command ApplyUpdateResponse;
handle command NotifyUpdateApplied;
}

server cluster OtaSoftwareUpdateRequestor {
callback attribute defaultOTAProviders;
ram attribute updatePossible default = true;
Expand Down Expand Up @@ -1901,6 +1960,19 @@ endpoint 1 {
handle command TriggerEffect;
}

server cluster OnOff {
ram attribute onOff default = 0;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 6;

handle command Off;
handle command On;
handle command Toggle;
}

server cluster Descriptor {
callback attribute deviceTypeList;
callback attribute serverList;
Expand Down
Loading

0 comments on commit 5fe9552

Please sign in to comment.