Skip to content

Commit

Permalink
Add initial boolean state config cluster impl (#30977)
Browse files Browse the repository at this point in the history
* update boolean configuration cluster according to latest spec

* compiling import of code from initial PR

* rename to boolean state configuration cluster

* regen after rename to boolean state configuration

* update device type and cluster names

* reflect cluster name change

* fixed typo

Co-authored-by: René Josefsen <[email protected]>

* fixed typo, regenerate zap, added Rain Sensor device type

* update missed cluster names after renaming

* rename and restyle

* update domain to Gereral as per https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/8686

* some more progress, needs testing

* restyle

* hopefully will fix CI errors on some platforms

* added AAI to handle CurrentSensitivityLevel

* fix CI int conversion error

* update ESP32 cmake file and regen

* updated event function, added SetAllEnabledAlarmsActive()

* TestEventTrigger implementation for BOOLCFG

* fix restyle

* started using AAI for CurrentSensitivityLevel persistency instead of attribute storage

* removed leftover code

* fix CI int conversion error on some platforms

* removed unused variable

* added range checking for SupportedSensitivityLevel
when reading or writing CurrentSensitivityLevel, removed leftover code

* changed error code to failure

* testing if removing old file fixes CI issue

---------

Co-authored-by: René Josefsen <[email protected]>
Co-authored-by: René Josefsen <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Jan 25, 2024
1 parent bb1fcf2 commit 5172115
Show file tree
Hide file tree
Showing 21 changed files with 1,083 additions and 225 deletions.
184 changes: 0 additions & 184 deletions data_model/clusters/BooleanSensorConfiguration.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3716,6 +3716,64 @@ cluster ActivatedCarbonFilterMonitoring = 114 {
command ResetCondition(): DefaultSuccess = 0;
}

/** This cluster is used to configure a boolean sensor. */
provisional cluster BooleanStateConfiguration = 128 {
revision 1;

bitmap AlarmModeBitmap : bitmap8 {
kVisual = 0x1;
kAudible = 0x2;
}

bitmap Feature : bitmap32 {
kVisual = 0x1;
kAudible = 0x2;
kAlarmSuppress = 0x4;
kSensitivityLevel = 0x8;
}

bitmap SensorFaultBitmap : bitmap16 {
kGeneralFault = 0x1;
}

info event AlarmsStateChanged = 0 {
AlarmModeBitmap alarmsActive = 0;
optional AlarmModeBitmap alarmsSuppressed = 1;
}

info event SensorFault = 1 {
SensorFaultBitmap sensorFault = 0;
}

attribute optional int8u currentSensitivityLevel = 0;
readonly attribute optional int8u supportedSensitivityLevels = 1;
readonly attribute optional int8u defaultSensitivityLevel = 2;
readonly attribute optional AlarmModeBitmap alarmsActive = 3;
readonly attribute optional AlarmModeBitmap alarmsSuppressed = 4;
readonly attribute optional AlarmModeBitmap alarmsEnabled = 5;
readonly attribute optional AlarmModeBitmap alarmsSupported = 6;
readonly attribute optional SensorFaultBitmap sensorFault = 7;
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 SuppressAlarmRequest {
AlarmModeBitmap alarmsToSuppress = 0;
}

request struct EnableDisableAlarmRequest {
AlarmModeBitmap alarmsToEnableDisable = 0;
}

/** This command is used to suppress the specified alarm mode. */
command SuppressAlarm(SuppressAlarmRequest): DefaultSuccess = 0;
/** This command is used to enable or disable the specified alarm mode. */
command EnableDisableAlarm(EnableDisableAlarmRequest): DefaultSuccess = 1;
}

/** This cluster is used to configure a valve. */
provisional cluster ValveConfigurationAndControl = 129 {
revision 1;
Expand Down Expand Up @@ -7492,6 +7550,28 @@ endpoint 1 {
handle command ResetCondition;
}

server cluster BooleanStateConfiguration {
emits event AlarmsStateChanged;
emits event SensorFault;
callback attribute currentSensitivityLevel;
ram attribute supportedSensitivityLevels default = 3;
ram attribute defaultSensitivityLevel default = 2;
ram attribute alarmsActive;
ram attribute alarmsSuppressed;
persist attribute alarmsEnabled;
ram attribute alarmsSupported default = 0x03;
ram attribute sensorFault default = 0;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0x0F;
ram attribute clusterRevision default = 1;

handle command SuppressAlarm;
handle command EnableDisableAlarm;
}

server cluster ValveConfigurationAndControl {
emits event ValveStateChanged;
emits event ValveFault;
Expand Down
Loading

0 comments on commit 5172115

Please sign in to comment.