Align naming in Power Source cluster with the spec. (#24240)
* Align naming in Power Source cluster with the spec.
And enable the Power Source events, which were commented out.
* Regenerate generated files.
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
index 754985f..2999f27 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
@@ -862,6 +862,21 @@
kReplaceable = 0x8;
}
+ info event WiredFaultChange = 0 {
+ WiredFault current[] = 0;
+ WiredFault previous[] = 1;
+ }
+
+ info event BatFaultChange = 1 {
+ BatFault current[] = 0;
+ BatFault previous[] = 1;
+ }
+
+ info event BatChargeFaultChange = 2 {
+ BatChargeFault current[] = 0;
+ BatChargeFault previous[] = 1;
+ }
+
readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
index 58e0c12..0ea0a31 100644
--- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
+++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter
@@ -794,6 +794,21 @@
kReplaceable = 0x8;
}
+ info event WiredFaultChange = 0 {
+ WiredFault current[] = 0;
+ WiredFault previous[] = 1;
+ }
+
+ info event BatFaultChange = 1 {
+ BatFault current[] = 0;
+ BatFault previous[] = 1;
+ }
+
+ info event BatChargeFaultChange = 2 {
+ BatChargeFault current[] = 0;
+ BatChargeFault previous[] = 1;
+ }
+
readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter
index 7251006..283c91d 100644
--- a/examples/lock-app/lock-common/lock-app.matter
+++ b/examples/lock-app/lock-common/lock-app.matter
@@ -455,6 +455,21 @@
kReplaceable = 0x8;
}
+ info event WiredFaultChange = 0 {
+ WiredFault current[] = 0;
+ WiredFault previous[] = 1;
+ }
+
+ info event BatFaultChange = 1 {
+ BatFault current[] = 0;
+ BatFault previous[] = 1;
+ }
+
+ info event BatChargeFaultChange = 2 {
+ BatChargeFault current[] = 0;
+ BatChargeFault previous[] = 1;
+ }
+
readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter
index 383b109..4ad37a9 100644
--- a/examples/placeholder/linux/apps/app1/config.matter
+++ b/examples/placeholder/linux/apps/app1/config.matter
@@ -627,6 +627,21 @@
kReplaceable = 0x8;
}
+ info event WiredFaultChange = 0 {
+ WiredFault current[] = 0;
+ WiredFault previous[] = 1;
+ }
+
+ info event BatFaultChange = 1 {
+ BatFault current[] = 0;
+ BatFault previous[] = 1;
+ }
+
+ info event BatChargeFaultChange = 2 {
+ BatChargeFault current[] = 0;
+ BatChargeFault previous[] = 1;
+ }
+
readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter
index 383b109..4ad37a9 100644
--- a/examples/placeholder/linux/apps/app2/config.matter
+++ b/examples/placeholder/linux/apps/app2/config.matter
@@ -627,6 +627,21 @@
kReplaceable = 0x8;
}
+ info event WiredFaultChange = 0 {
+ WiredFault current[] = 0;
+ WiredFault previous[] = 1;
+ }
+
+ info event BatFaultChange = 1 {
+ BatFault current[] = 0;
+ BatFault previous[] = 1;
+ }
+
+ info event BatChargeFaultChange = 2 {
+ BatChargeFault current[] = 0;
+ BatChargeFault previous[] = 1;
+ }
+
readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter
index 578b658..cd0a0e7 100644
--- a/examples/window-app/common/window-app.matter
+++ b/examples/window-app/common/window-app.matter
@@ -617,6 +617,21 @@
kReplaceable = 0x8;
}
+ info event WiredFaultChange = 0 {
+ WiredFault current[] = 0;
+ WiredFault previous[] = 1;
+ }
+
+ info event BatFaultChange = 1 {
+ BatFault current[] = 0;
+ BatFault previous[] = 1;
+ }
+
+ info event BatChargeFaultChange = 2 {
+ BatChargeFault current[] = 0;
+ BatChargeFault previous[] = 1;
+ }
+
readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml
index 28ba55b..76b350a 100644
--- a/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml
+++ b/src/app/zap-templates/zcl/data-model/chip/power-source-cluster.xml
@@ -59,22 +59,23 @@
<attribute side="server" code="0x001D" define="POWER_SOURCE_BAT_CHARGING_CURRENT" type="INT32U" min="0x00000000" max="0xFFFFFFFF" writable="false" optional="true" isNullable="true">BatChargingCurrent</attribute>
<attribute side="server" code="0x001E" define="POWER_SOURCE_ACTIVE_BAT_CHARGE_FAULTS" type="ARRAY" entryType="BatChargeFault" length="16" writable="false" optional="true">ActiveBatChargeFaults</attribute>
- <!-- TODO: Do events work?
- <event code="0x0000" name="WiredFaultChange" priority="info" side="server">
+ <event code="0x0000" name="WiredFaultChange" priority="info" side="server" optional="true">
<description>The WiredFaultChange Event SHALL indicate a change in the set of wired faults currently detected by the Node on this wired power source.</description>
- <field id="1" name="WiredFaultChangeType" type="WiredFaultChangeType"/>
+ <field id="0" name="Current" type="WiredFault" array="true" length="8"/>
+ <field id="1" name="Previous" type="WiredFault" array="true" length="8"/>
</event>
- <event code="0x0001" name="BatFaultChange" priority="info" side="server">
+ <event code="0x0001" name="BatFaultChange" priority="info" side="server" optional="true">
<description>The BatFaultChange Event SHALL indicate a change in the set of battery faults currently detected by the Node on this battery power source.</description>
- <field id="1" name="BatFaultChangeType" type="BatFaultChangeType"/>
+ <field id="0" name="Current" type="BatFault" array="true" length="8"/>
+ <field id="1" name="Previous" type="BatFault" array="true" length="8"/>
</event>
- <event code="0x0002" name="BatChargeFaultChange" priority="info" side="server">
+ <event code="0x0002" name="BatChargeFaultChange" priority="info" side="server" optional="true">
<description>The BatChargeFaultChange Event SHALL indicate a change in the set of charge faults currently detected by the Node on this battery power source.</description>
- <field id="1" name="BatChargeFaultChangeType" type="BatChargeFaultChangeType"/>
+ <field id="0" name="Current" type="BatChargeFault" array="true" length="16"/>
+ <field id="1" name="Previous" type="BatChargeFault" array="true" length="16"/>
</event>
- -->
</cluster>
@@ -131,7 +132,7 @@
<enum name="BatChargeLevel" type="ENUM8">
<cluster code="0x002F"/>
- <item name="Ok" value="0x00"/>
+ <item name="OK" value="0x00"/>
<item name="Warning" value="0x01"/>
<item name="Critical" value="0x02"/>
</enum>
@@ -152,6 +153,8 @@
<item name="IsNotCharging" value="0x03"/>
</enum>
+ <!-- TODO: These structs *ChangeType structs should just be removed, after a
+ brief deprecation period. -->
<struct name="WiredFaultChangeType">
<cluster code="0x002F"/>
<item name="current" type="WiredFault" array="true" length="8"/>
@@ -170,4 +173,4 @@
<item name="previous" type="BatChargeFault" array="true" length="16"/>
</struct>
-</configurator>
\ No newline at end of file
+</configurator>
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index d3ce743..4de517e 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -995,6 +995,21 @@
kReplaceable = 0x8;
}
+ info event WiredFaultChange = 0 {
+ WiredFault current[] = 0;
+ WiredFault previous[] = 1;
+ }
+
+ info event BatFaultChange = 1 {
+ BatFault current[] = 0;
+ BatFault previous[] = 1;
+ }
+
+ info event BatChargeFaultChange = 2 {
+ BatChargeFault current[] = 0;
+ BatChargeFault previous[] = 1;
+ }
+
readonly attribute PowerSourceStatus status = 0;
readonly attribute int8u order = 1;
readonly attribute char_string<60> description = 2;
diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
index d8b949d..8313fe2 100644
--- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
+++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp
@@ -967,6 +967,179 @@
using namespace app::Clusters::PowerSource;
switch (aPath.mEventId)
{
+ case Events::WiredFaultChange::Id: {
+ Events::WiredFaultChange::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value_current;
+ chip::JniReferences::GetInstance().CreateArrayList(value_current);
+
+ auto iter_value_current_0 = cppValue.current.begin();
+ while (iter_value_current_0.Next())
+ {
+ auto & entry_0 = iter_value_current_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Integer";
+ std::string newElement_0CtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject<uint8_t>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast<uint8_t>(entry_0), newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value_current, newElement_0);
+ }
+
+ jobject value_previous;
+ chip::JniReferences::GetInstance().CreateArrayList(value_previous);
+
+ auto iter_value_previous_0 = cppValue.previous.begin();
+ while (iter_value_previous_0.Next())
+ {
+ auto & entry_0 = iter_value_previous_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Integer";
+ std::string newElement_0CtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject<uint8_t>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast<uint8_t>(entry_0), newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value_previous, newElement_0);
+ }
+
+ jclass wiredFaultChangeStructClass;
+ err = chip::JniReferences::GetInstance().GetClassRef(
+ env, "chip/devicecontroller/ChipEventStructs$PowerSourceClusterWiredFaultChangeEvent", wiredFaultChangeStructClass);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipEventStructs$PowerSourceClusterWiredFaultChangeEvent");
+ return nullptr;
+ }
+ jmethodID wiredFaultChangeStructCtor =
+ env->GetMethodID(wiredFaultChangeStructClass, "<init>", "(Ljava/util/ArrayList;Ljava/util/ArrayList;)V");
+ if (wiredFaultChangeStructCtor == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipEventStructs$PowerSourceClusterWiredFaultChangeEvent constructor");
+ return nullptr;
+ }
+
+ jobject value = env->NewObject(wiredFaultChangeStructClass, wiredFaultChangeStructCtor, value_current, value_previous);
+
+ return value;
+ }
+ case Events::BatFaultChange::Id: {
+ Events::BatFaultChange::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value_current;
+ chip::JniReferences::GetInstance().CreateArrayList(value_current);
+
+ auto iter_value_current_0 = cppValue.current.begin();
+ while (iter_value_current_0.Next())
+ {
+ auto & entry_0 = iter_value_current_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Integer";
+ std::string newElement_0CtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject<uint8_t>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast<uint8_t>(entry_0), newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value_current, newElement_0);
+ }
+
+ jobject value_previous;
+ chip::JniReferences::GetInstance().CreateArrayList(value_previous);
+
+ auto iter_value_previous_0 = cppValue.previous.begin();
+ while (iter_value_previous_0.Next())
+ {
+ auto & entry_0 = iter_value_previous_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Integer";
+ std::string newElement_0CtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject<uint8_t>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast<uint8_t>(entry_0), newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value_previous, newElement_0);
+ }
+
+ jclass batFaultChangeStructClass;
+ err = chip::JniReferences::GetInstance().GetClassRef(
+ env, "chip/devicecontroller/ChipEventStructs$PowerSourceClusterBatFaultChangeEvent", batFaultChangeStructClass);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipEventStructs$PowerSourceClusterBatFaultChangeEvent");
+ return nullptr;
+ }
+ jmethodID batFaultChangeStructCtor =
+ env->GetMethodID(batFaultChangeStructClass, "<init>", "(Ljava/util/ArrayList;Ljava/util/ArrayList;)V");
+ if (batFaultChangeStructCtor == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipEventStructs$PowerSourceClusterBatFaultChangeEvent constructor");
+ return nullptr;
+ }
+
+ jobject value = env->NewObject(batFaultChangeStructClass, batFaultChangeStructCtor, value_current, value_previous);
+
+ return value;
+ }
+ case Events::BatChargeFaultChange::Id: {
+ Events::BatChargeFaultChange::DecodableType cppValue;
+ *aError = app::DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR)
+ {
+ return nullptr;
+ }
+ jobject value_current;
+ chip::JniReferences::GetInstance().CreateArrayList(value_current);
+
+ auto iter_value_current_0 = cppValue.current.begin();
+ while (iter_value_current_0.Next())
+ {
+ auto & entry_0 = iter_value_current_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Integer";
+ std::string newElement_0CtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject<uint8_t>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast<uint8_t>(entry_0), newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value_current, newElement_0);
+ }
+
+ jobject value_previous;
+ chip::JniReferences::GetInstance().CreateArrayList(value_previous);
+
+ auto iter_value_previous_0 = cppValue.previous.begin();
+ while (iter_value_previous_0.Next())
+ {
+ auto & entry_0 = iter_value_previous_0.GetValue();
+ jobject newElement_0;
+ std::string newElement_0ClassName = "java/lang/Integer";
+ std::string newElement_0CtorSignature = "(I)V";
+ chip::JniReferences::GetInstance().CreateBoxedObject<uint8_t>(
+ newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), static_cast<uint8_t>(entry_0), newElement_0);
+ chip::JniReferences::GetInstance().AddToList(value_previous, newElement_0);
+ }
+
+ jclass batChargeFaultChangeStructClass;
+ err = chip::JniReferences::GetInstance().GetClassRef(
+ env, "chip/devicecontroller/ChipEventStructs$PowerSourceClusterBatChargeFaultChangeEvent",
+ batChargeFaultChangeStructClass);
+ if (err != CHIP_NO_ERROR)
+ {
+ ChipLogError(Zcl, "Could not find class ChipEventStructs$PowerSourceClusterBatChargeFaultChangeEvent");
+ return nullptr;
+ }
+ jmethodID batChargeFaultChangeStructCtor =
+ env->GetMethodID(batChargeFaultChangeStructClass, "<init>", "(Ljava/util/ArrayList;Ljava/util/ArrayList;)V");
+ if (batChargeFaultChangeStructCtor == nullptr)
+ {
+ ChipLogError(Zcl, "Could not find ChipEventStructs$PowerSourceClusterBatChargeFaultChangeEvent constructor");
+ return nullptr;
+ }
+
+ jobject value =
+ env->NewObject(batChargeFaultChangeStructClass, batChargeFaultChangeStructCtor, value_current, value_previous);
+
+ return value;
+ }
default:
*aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB;
break;
diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java
index fe77f36..2040b03 100644
--- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java
+++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java
@@ -347,6 +347,81 @@
}
}
+ public static class PowerSourceClusterWiredFaultChangeEvent {
+ public ArrayList<Object> current;
+ public ArrayList<Object> previous;
+
+ public PowerSourceClusterWiredFaultChangeEvent(
+ ArrayList<Object> current, ArrayList<Object> previous) {
+ this.current = current;
+ this.previous = previous;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("PowerSourceClusterWiredFaultChangeEvent {\n");
+ output.append("\tcurrent: ");
+ output.append(current);
+ output.append("\n");
+ output.append("\tprevious: ");
+ output.append(previous);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+ }
+
+ public static class PowerSourceClusterBatFaultChangeEvent {
+ public ArrayList<Object> current;
+ public ArrayList<Object> previous;
+
+ public PowerSourceClusterBatFaultChangeEvent(
+ ArrayList<Object> current, ArrayList<Object> previous) {
+ this.current = current;
+ this.previous = previous;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("PowerSourceClusterBatFaultChangeEvent {\n");
+ output.append("\tcurrent: ");
+ output.append(current);
+ output.append("\n");
+ output.append("\tprevious: ");
+ output.append(previous);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+ }
+
+ public static class PowerSourceClusterBatChargeFaultChangeEvent {
+ public ArrayList<Object> current;
+ public ArrayList<Object> previous;
+
+ public PowerSourceClusterBatChargeFaultChangeEvent(
+ ArrayList<Object> current, ArrayList<Object> previous) {
+ this.current = current;
+ this.previous = previous;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder output = new StringBuilder();
+ output.append("PowerSourceClusterBatChargeFaultChangeEvent {\n");
+ output.append("\tcurrent: ");
+ output.append(current);
+ output.append("\n");
+ output.append("\tprevious: ");
+ output.append(previous);
+ output.append("\n");
+ output.append("}\n");
+ return output.toString();
+ }
+ }
+
public static class GeneralDiagnosticsClusterHardwareFaultChangeEvent {
public ArrayList<Object> current;
public ArrayList<Object> previous;
diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java
index 0bcad38..195215f 100644
--- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java
+++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java
@@ -3183,6 +3183,15 @@
return "";
}
if (clusterId == 47L) {
+ if (eventId == 0L) {
+ return "WiredFaultChange";
+ }
+ if (eventId == 1L) {
+ return "BatFaultChange";
+ }
+ if (eventId == 2L) {
+ return "BatChargeFaultChange";
+ }
return "";
}
if (clusterId == 48L) {
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index a72378c..6dea0ef 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -6171,6 +6171,70 @@
value: 'uint' = 0
+ class Events:
+ @dataclass
+ class WiredFaultChange(ClusterEvent):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x002F
+
+ @ChipUtility.classproperty
+ def event_id(cls) -> int:
+ return 0x00000000
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields = [
+ ClusterObjectFieldDescriptor(Label="current", Tag=0, Type=typing.List[PowerSource.Enums.WiredFault]),
+ ClusterObjectFieldDescriptor(Label="previous", Tag=1, Type=typing.List[PowerSource.Enums.WiredFault]),
+ ])
+
+ current: 'typing.List[PowerSource.Enums.WiredFault]' = field(default_factory=lambda: [])
+ previous: 'typing.List[PowerSource.Enums.WiredFault]' = field(default_factory=lambda: [])
+
+ @dataclass
+ class BatFaultChange(ClusterEvent):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x002F
+
+ @ChipUtility.classproperty
+ def event_id(cls) -> int:
+ return 0x00000001
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields = [
+ ClusterObjectFieldDescriptor(Label="current", Tag=0, Type=typing.List[PowerSource.Enums.BatFault]),
+ ClusterObjectFieldDescriptor(Label="previous", Tag=1, Type=typing.List[PowerSource.Enums.BatFault]),
+ ])
+
+ current: 'typing.List[PowerSource.Enums.BatFault]' = field(default_factory=lambda: [])
+ previous: 'typing.List[PowerSource.Enums.BatFault]' = field(default_factory=lambda: [])
+
+ @dataclass
+ class BatChargeFaultChange(ClusterEvent):
+ @ChipUtility.classproperty
+ def cluster_id(cls) -> int:
+ return 0x002F
+
+ @ChipUtility.classproperty
+ def event_id(cls) -> int:
+ return 0x00000002
+
+ @ChipUtility.classproperty
+ def descriptor(cls) -> ClusterObjectDescriptor:
+ return ClusterObjectDescriptor(
+ Fields = [
+ ClusterObjectFieldDescriptor(Label="current", Tag=0, Type=typing.List[PowerSource.Enums.BatChargeFault]),
+ ClusterObjectFieldDescriptor(Label="previous", Tag=1, Type=typing.List[PowerSource.Enums.BatChargeFault]),
+ ])
+
+ current: 'typing.List[PowerSource.Enums.BatChargeFault]' = field(default_factory=lambda: [])
+ previous: 'typing.List[PowerSource.Enums.BatChargeFault]' = field(default_factory=lambda: [])
+
@dataclass
class GeneralCommissioning(Cluster):
diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml
index 010bddd..bc301ad 100644
--- a/src/darwin/Framework/CHIP/templates/availability.yaml
+++ b/src/darwin/Framework/CHIP/templates/availability.yaml
@@ -5043,6 +5043,10 @@
- ShutDown
- Leave
- ReachableChanged
+ PowerSource:
+ - WiredFaultChange
+ - BatFaultChange
+ - BatChargeFaultChange
event fields:
Switch:
MultiPressComplete:
@@ -5078,6 +5082,16 @@
- fabricIndex
ReachableChanged:
- reachableNewValue
+ PowerSource:
+ WiredFaultChange:
+ - current
+ - previous
+ BatFaultChange:
+ - current
+ - previous
+ BatChargeFaultChange:
+ - current
+ - previous
enums:
OTASoftwareUpdateProvider:
- OTAApplyUpdateAction
@@ -5149,6 +5163,9 @@
- PASE
- CASE
- Group
+ PowerSource:
+ BatChargeLevel:
+ - OK
bitmaps:
UnitTesting:
- Bitmap8MaskMap
@@ -5229,6 +5246,10 @@
AccessControl:
- AccessControlEntry
- ExtensionEntry
+ PowerSource:
+ - WiredFaultChangeType
+ - BatFaultChangeType
+ - BatChargeFaultChangeType
struct fields:
Descriptor:
DeviceTypeStruct:
@@ -5245,6 +5266,9 @@
GeneralCommissioning:
CommissioningError:
- Ok
+ PowerSource:
+ BatChargeLevel:
+ - Ok
apis:
- Timed Invoke for server to client commands
- Deprecated global attribute names
@@ -5320,3 +5344,6 @@
GeneralCommissioning:
CommissioningError:
OK: Ok
+ PowerSource:
+ BatChargeLevel:
+ OK: Ok
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
index c433a20..7999ed9 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
@@ -17416,7 +17416,10 @@
} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
typedef NS_ENUM(uint8_t, MTRPowerSourceBatChargeLevel) {
- MTRPowerSourceBatChargeLevelOk API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00,
+ MTRPowerSourceBatChargeLevelOK MTR_NEWLY_AVAILABLE = 0x00,
+ MTRPowerSourceBatChargeLevelOk API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+ MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceBatChargeLevelOK")
+ = 0x00,
MTRPowerSourceBatChargeLevelWarning API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01,
MTRPowerSourceBatChargeLevelCritical API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02,
} API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
index 53942f6..bdc6ae0 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h
@@ -6821,6 +6821,13 @@
MTREventIDTypeClusterOTASoftwareUpdateRequestorEventVersionAppliedID MTR_NEWLY_AVAILABLE = 0x00000001,
MTREventIDTypeClusterOTASoftwareUpdateRequestorEventDownloadErrorID MTR_NEWLY_AVAILABLE = 0x00000002,
+ // Cluster PowerSource deprecated event names
+
+ // Cluster PowerSource events
+ MTREventIDTypeClusterPowerSourceEventWiredFaultChangeID MTR_NEWLY_AVAILABLE = 0x00000000,
+ MTREventIDTypeClusterPowerSourceEventBatFaultChangeID MTR_NEWLY_AVAILABLE = 0x00000001,
+ MTREventIDTypeClusterPowerSourceEventBatChargeFaultChangeID MTR_NEWLY_AVAILABLE = 0x00000002,
+
// Cluster GeneralDiagnostics deprecated event names
MTRClusterGeneralDiagnosticsEventHardwareFaultChangeID API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
MTR_NEWLY_DEPRECATED("Please use MTREventIDTypeClusterGeneralDiagnosticsEventHardwareFaultChangeID")
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
index 8e5f792..a2fa781 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm
@@ -610,6 +610,165 @@
using namespace Clusters::PowerSource;
switch (aPath.mEventId) {
+ case Events::WiredFaultChange::Id: {
+ Events::WiredFaultChange::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+
+ __auto_type * value = [MTRPowerSourceClusterWiredFaultChangeEvent new];
+
+ do {
+ NSArray * _Nonnull memberValue;
+ { // Scope for our temporary variables
+ auto * array_0 = [NSMutableArray new];
+ auto iter_0 = cppValue.current.begin();
+ while (iter_0.Next()) {
+ auto & entry_0 = iter_0.GetValue();
+ NSNumber * newElement_0;
+ newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)];
+ [array_0 addObject:newElement_0];
+ }
+ CHIP_ERROR err = iter_0.GetStatus();
+ if (err != CHIP_NO_ERROR) {
+ *aError = err;
+ return nil;
+ }
+ memberValue = array_0;
+ }
+ value.current = memberValue;
+ } while (0);
+ do {
+ NSArray * _Nonnull memberValue;
+ { // Scope for our temporary variables
+ auto * array_0 = [NSMutableArray new];
+ auto iter_0 = cppValue.previous.begin();
+ while (iter_0.Next()) {
+ auto & entry_0 = iter_0.GetValue();
+ NSNumber * newElement_0;
+ newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)];
+ [array_0 addObject:newElement_0];
+ }
+ CHIP_ERROR err = iter_0.GetStatus();
+ if (err != CHIP_NO_ERROR) {
+ *aError = err;
+ return nil;
+ }
+ memberValue = array_0;
+ }
+ value.previous = memberValue;
+ } while (0);
+
+ return value;
+ }
+
+ case Events::BatFaultChange::Id: {
+ Events::BatFaultChange::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+
+ __auto_type * value = [MTRPowerSourceClusterBatFaultChangeEvent new];
+
+ do {
+ NSArray * _Nonnull memberValue;
+ { // Scope for our temporary variables
+ auto * array_0 = [NSMutableArray new];
+ auto iter_0 = cppValue.current.begin();
+ while (iter_0.Next()) {
+ auto & entry_0 = iter_0.GetValue();
+ NSNumber * newElement_0;
+ newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)];
+ [array_0 addObject:newElement_0];
+ }
+ CHIP_ERROR err = iter_0.GetStatus();
+ if (err != CHIP_NO_ERROR) {
+ *aError = err;
+ return nil;
+ }
+ memberValue = array_0;
+ }
+ value.current = memberValue;
+ } while (0);
+ do {
+ NSArray * _Nonnull memberValue;
+ { // Scope for our temporary variables
+ auto * array_0 = [NSMutableArray new];
+ auto iter_0 = cppValue.previous.begin();
+ while (iter_0.Next()) {
+ auto & entry_0 = iter_0.GetValue();
+ NSNumber * newElement_0;
+ newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)];
+ [array_0 addObject:newElement_0];
+ }
+ CHIP_ERROR err = iter_0.GetStatus();
+ if (err != CHIP_NO_ERROR) {
+ *aError = err;
+ return nil;
+ }
+ memberValue = array_0;
+ }
+ value.previous = memberValue;
+ } while (0);
+
+ return value;
+ }
+
+ case Events::BatChargeFaultChange::Id: {
+ Events::BatChargeFaultChange::DecodableType cppValue;
+ *aError = DataModel::Decode(aReader, cppValue);
+ if (*aError != CHIP_NO_ERROR) {
+ return nil;
+ }
+
+ __auto_type * value = [MTRPowerSourceClusterBatChargeFaultChangeEvent new];
+
+ do {
+ NSArray * _Nonnull memberValue;
+ { // Scope for our temporary variables
+ auto * array_0 = [NSMutableArray new];
+ auto iter_0 = cppValue.current.begin();
+ while (iter_0.Next()) {
+ auto & entry_0 = iter_0.GetValue();
+ NSNumber * newElement_0;
+ newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)];
+ [array_0 addObject:newElement_0];
+ }
+ CHIP_ERROR err = iter_0.GetStatus();
+ if (err != CHIP_NO_ERROR) {
+ *aError = err;
+ return nil;
+ }
+ memberValue = array_0;
+ }
+ value.current = memberValue;
+ } while (0);
+ do {
+ NSArray * _Nonnull memberValue;
+ { // Scope for our temporary variables
+ auto * array_0 = [NSMutableArray new];
+ auto iter_0 = cppValue.previous.begin();
+ while (iter_0.Next()) {
+ auto & entry_0 = iter_0.GetValue();
+ NSNumber * newElement_0;
+ newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)];
+ [array_0 addObject:newElement_0];
+ }
+ CHIP_ERROR err = iter_0.GetStatus();
+ if (err != CHIP_NO_ERROR) {
+ *aError = err;
+ return nil;
+ }
+ memberValue = array_0;
+ }
+ value.previous = memberValue;
+ } while (0);
+
+ return value;
+ }
+
default:
*aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB;
break;
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
index e67a974..9c5aa2e 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h
@@ -239,21 +239,48 @@
@end
API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+MTR_NEWLY_DEPRECATED("This struct is unused and will be removed")
@interface MTRPowerSourceClusterBatChargeFaultChangeType : NSObject <NSCopying>
-@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
-@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
+@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+ MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterBatChargeFaultChangeType");
+@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+ MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterBatChargeFaultChangeType");
@end
API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+MTR_NEWLY_DEPRECATED("This struct is unused and will be removed")
@interface MTRPowerSourceClusterBatFaultChangeType : NSObject <NSCopying>
-@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
-@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
+@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+ MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterBatFaultChangeType");
+@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+ MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterBatFaultChangeType");
@end
API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+MTR_NEWLY_DEPRECATED("This struct is unused and will be removed")
@interface MTRPowerSourceClusterWiredFaultChangeType : NSObject <NSCopying>
-@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
-@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1));
+@property (nonatomic, copy) NSArray * _Nonnull current API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+ MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterWiredFaultChangeType");
+@property (nonatomic, copy) NSArray * _Nonnull previous API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
+ MTR_NEWLY_DEPRECATED("Please use MTRPowerSourceClusterWiredFaultChangeType");
+@end
+
+MTR_NEWLY_AVAILABLE
+@interface MTRPowerSourceClusterWiredFaultChangeEvent : NSObject <NSCopying>
+@property (nonatomic, copy) NSArray * _Nonnull current MTR_NEWLY_AVAILABLE;
+@property (nonatomic, copy) NSArray * _Nonnull previous MTR_NEWLY_AVAILABLE;
+@end
+
+MTR_NEWLY_AVAILABLE
+@interface MTRPowerSourceClusterBatFaultChangeEvent : NSObject <NSCopying>
+@property (nonatomic, copy) NSArray * _Nonnull current MTR_NEWLY_AVAILABLE;
+@property (nonatomic, copy) NSArray * _Nonnull previous MTR_NEWLY_AVAILABLE;
+@end
+
+MTR_NEWLY_AVAILABLE
+@interface MTRPowerSourceClusterBatChargeFaultChangeEvent : NSObject <NSCopying>
+@property (nonatomic, copy) NSArray * _Nonnull current MTR_NEWLY_AVAILABLE;
+@property (nonatomic, copy) NSArray * _Nonnull previous MTR_NEWLY_AVAILABLE;
@end
API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1))
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
index 178783a..bdb39bf 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm
@@ -910,6 +910,99 @@
@end
+@implementation MTRPowerSourceClusterWiredFaultChangeEvent
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _current = [NSArray array];
+
+ _previous = [NSArray array];
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone
+{
+ auto other = [[MTRPowerSourceClusterWiredFaultChangeEvent alloc] init];
+
+ other.current = self.current;
+ other.previous = self.previous;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString =
+ [NSString stringWithFormat:@"<%@: current:%@; previous:%@; >", NSStringFromClass([self class]), _current, _previous];
+ return descriptionString;
+}
+
+@end
+
+@implementation MTRPowerSourceClusterBatFaultChangeEvent
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _current = [NSArray array];
+
+ _previous = [NSArray array];
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone
+{
+ auto other = [[MTRPowerSourceClusterBatFaultChangeEvent alloc] init];
+
+ other.current = self.current;
+ other.previous = self.previous;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString =
+ [NSString stringWithFormat:@"<%@: current:%@; previous:%@; >", NSStringFromClass([self class]), _current, _previous];
+ return descriptionString;
+}
+
+@end
+
+@implementation MTRPowerSourceClusterBatChargeFaultChangeEvent
+- (instancetype)init
+{
+ if (self = [super init]) {
+
+ _current = [NSArray array];
+
+ _previous = [NSArray array];
+ }
+ return self;
+}
+
+- (id)copyWithZone:(NSZone * _Nullable)zone
+{
+ auto other = [[MTRPowerSourceClusterBatChargeFaultChangeEvent alloc] init];
+
+ other.current = self.current;
+ other.previous = self.previous;
+
+ return other;
+}
+
+- (NSString *)description
+{
+ NSString * descriptionString =
+ [NSString stringWithFormat:@"<%@: current:%@; previous:%@; >", NSStringFromClass([self class]), _current, _previous];
+ return descriptionString;
+}
+
+@end
+
@implementation MTRGeneralCommissioningClusterBasicCommissioningInfo
- (instancetype)init
{
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
index 448310e..2d1476b 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp
@@ -5241,6 +5241,129 @@
} // namespace Attributes
namespace Events {
+namespace WiredFaultChange {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const
+{
+ TLV::TLVType outer;
+ ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer));
+ ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrent)), current));
+ ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPrevious)), previous));
+ ReturnErrorOnFailure(writer.EndContainer(outer));
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ TLV::TLVType outer;
+ VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE);
+ ReturnErrorOnFailure(reader.EnterContainer(outer));
+ while ((err = reader.Next()) == CHIP_NO_ERROR)
+ {
+ if (!TLV::IsContextTag(reader.GetTag()))
+ {
+ continue;
+ }
+ switch (TLV::TagNumFromTag(reader.GetTag()))
+ {
+ case to_underlying(Fields::kCurrent):
+ ReturnErrorOnFailure(DataModel::Decode(reader, current));
+ break;
+ case to_underlying(Fields::kPrevious):
+ ReturnErrorOnFailure(DataModel::Decode(reader, previous));
+ break;
+ default:
+ break;
+ }
+ }
+
+ VerifyOrReturnError(err == CHIP_END_OF_TLV, err);
+ ReturnErrorOnFailure(reader.ExitContainer(outer));
+ return CHIP_NO_ERROR;
+}
+} // namespace WiredFaultChange.
+namespace BatFaultChange {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const
+{
+ TLV::TLVType outer;
+ ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer));
+ ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrent)), current));
+ ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPrevious)), previous));
+ ReturnErrorOnFailure(writer.EndContainer(outer));
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ TLV::TLVType outer;
+ VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE);
+ ReturnErrorOnFailure(reader.EnterContainer(outer));
+ while ((err = reader.Next()) == CHIP_NO_ERROR)
+ {
+ if (!TLV::IsContextTag(reader.GetTag()))
+ {
+ continue;
+ }
+ switch (TLV::TagNumFromTag(reader.GetTag()))
+ {
+ case to_underlying(Fields::kCurrent):
+ ReturnErrorOnFailure(DataModel::Decode(reader, current));
+ break;
+ case to_underlying(Fields::kPrevious):
+ ReturnErrorOnFailure(DataModel::Decode(reader, previous));
+ break;
+ default:
+ break;
+ }
+ }
+
+ VerifyOrReturnError(err == CHIP_END_OF_TLV, err);
+ ReturnErrorOnFailure(reader.ExitContainer(outer));
+ return CHIP_NO_ERROR;
+}
+} // namespace BatFaultChange.
+namespace BatChargeFaultChange {
+CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const
+{
+ TLV::TLVType outer;
+ ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer));
+ ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrent)), current));
+ ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kPrevious)), previous));
+ ReturnErrorOnFailure(writer.EndContainer(outer));
+ return CHIP_NO_ERROR;
+}
+
+CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader)
+{
+ CHIP_ERROR err = CHIP_NO_ERROR;
+ TLV::TLVType outer;
+ VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE);
+ ReturnErrorOnFailure(reader.EnterContainer(outer));
+ while ((err = reader.Next()) == CHIP_NO_ERROR)
+ {
+ if (!TLV::IsContextTag(reader.GetTag()))
+ {
+ continue;
+ }
+ switch (TLV::TagNumFromTag(reader.GetTag()))
+ {
+ case to_underlying(Fields::kCurrent):
+ ReturnErrorOnFailure(DataModel::Decode(reader, current));
+ break;
+ case to_underlying(Fields::kPrevious):
+ ReturnErrorOnFailure(DataModel::Decode(reader, previous));
+ break;
+ default:
+ break;
+ }
+ }
+
+ VerifyOrReturnError(err == CHIP_END_OF_TLV, err);
+ ReturnErrorOnFailure(reader.ExitContainer(outer));
+ return CHIP_NO_ERROR;
+}
+} // namespace BatChargeFaultChange.
} // namespace Events
} // namespace PowerSource
diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
index f670799..d9a23bf 100644
--- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
+++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h
@@ -6375,6 +6375,116 @@
};
};
} // namespace Attributes
+namespace Events {
+namespace WiredFaultChange {
+static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;
+
+enum class Fields
+{
+ kCurrent = 0,
+ kPrevious = 1,
+};
+
+struct Type
+{
+public:
+ static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
+ static constexpr EventId GetEventId() { return Events::WiredFaultChange::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; }
+ static constexpr bool kIsFabricScoped = false;
+
+ DataModel::List<const WiredFault> current;
+ DataModel::List<const WiredFault> previous;
+
+ CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const;
+};
+
+struct DecodableType
+{
+public:
+ static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
+ static constexpr EventId GetEventId() { return Events::WiredFaultChange::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; }
+
+ DataModel::DecodableList<WiredFault> current;
+ DataModel::DecodableList<WiredFault> previous;
+
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+} // namespace WiredFaultChange
+namespace BatFaultChange {
+static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;
+
+enum class Fields
+{
+ kCurrent = 0,
+ kPrevious = 1,
+};
+
+struct Type
+{
+public:
+ static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
+ static constexpr EventId GetEventId() { return Events::BatFaultChange::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; }
+ static constexpr bool kIsFabricScoped = false;
+
+ DataModel::List<const BatFault> current;
+ DataModel::List<const BatFault> previous;
+
+ CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const;
+};
+
+struct DecodableType
+{
+public:
+ static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
+ static constexpr EventId GetEventId() { return Events::BatFaultChange::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; }
+
+ DataModel::DecodableList<BatFault> current;
+ DataModel::DecodableList<BatFault> previous;
+
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+} // namespace BatFaultChange
+namespace BatChargeFaultChange {
+static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;
+
+enum class Fields
+{
+ kCurrent = 0,
+ kPrevious = 1,
+};
+
+struct Type
+{
+public:
+ static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
+ static constexpr EventId GetEventId() { return Events::BatChargeFaultChange::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; }
+ static constexpr bool kIsFabricScoped = false;
+
+ DataModel::List<const BatChargeFault> current;
+ DataModel::List<const BatChargeFault> previous;
+
+ CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const;
+};
+
+struct DecodableType
+{
+public:
+ static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
+ static constexpr EventId GetEventId() { return Events::BatChargeFaultChange::Id; }
+ static constexpr ClusterId GetClusterId() { return Clusters::PowerSource::Id; }
+
+ DataModel::DecodableList<BatChargeFault> current;
+ DataModel::DecodableList<BatChargeFault> previous;
+
+ CHIP_ERROR Decode(TLV::TLVReader & reader);
+};
+} // namespace BatChargeFaultChange
+} // namespace Events
} // namespace PowerSource
namespace GeneralCommissioning {
namespace Structs {
diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h
index 8dbc9ea..e885f58 100644
--- a/zzz_generated/app-common/app-common/zap-generated/ids/Events.h
+++ b/zzz_generated/app-common/app-common/zap-generated/ids/Events.h
@@ -93,6 +93,24 @@
} // namespace Events
} // namespace OtaSoftwareUpdateRequestor
+namespace PowerSource {
+namespace Events {
+
+namespace WiredFaultChange {
+static constexpr EventId Id = 0x00000000;
+} // namespace WiredFaultChange
+
+namespace BatFaultChange {
+static constexpr EventId Id = 0x00000001;
+} // namespace BatFaultChange
+
+namespace BatChargeFaultChange {
+static constexpr EventId Id = 0x00000002;
+} // namespace BatChargeFaultChange
+
+} // namespace Events
+} // namespace PowerSource
+
namespace GeneralDiagnostics {
namespace Events {
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
index 845ea56..8fbfa60 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h
@@ -2175,6 +2175,9 @@
| * ClusterRevision | 0xFFFD |
|------------------------------------------------------------------------------|
| Events: | |
+| * WiredFaultChange | 0x0000 |
+| * BatFaultChange | 0x0001 |
+| * BatChargeFaultChange | 0x0002 |
\*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*\
@@ -9402,8 +9405,14 @@
//
// Events
//
- make_unique<ReadEvent>(Id, credsIssuerConfig), //
- make_unique<SubscribeEvent>(Id, credsIssuerConfig), //
+ make_unique<ReadEvent>(Id, credsIssuerConfig), //
+ make_unique<ReadEvent>(Id, "wired-fault-change", Events::WiredFaultChange::Id, credsIssuerConfig), //
+ make_unique<ReadEvent>(Id, "bat-fault-change", Events::BatFaultChange::Id, credsIssuerConfig), //
+ make_unique<ReadEvent>(Id, "bat-charge-fault-change", Events::BatChargeFaultChange::Id, credsIssuerConfig), //
+ make_unique<SubscribeEvent>(Id, credsIssuerConfig), //
+ make_unique<SubscribeEvent>(Id, "wired-fault-change", Events::WiredFaultChange::Id, credsIssuerConfig), //
+ make_unique<SubscribeEvent>(Id, "bat-fault-change", Events::BatFaultChange::Id, credsIssuerConfig), //
+ make_unique<SubscribeEvent>(Id, "bat-charge-fault-change", Events::BatChargeFaultChange::Id, credsIssuerConfig), //
};
commands.Register(clusterName, clusterCommands);
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
index 15e1dc6..5e4ec74 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp
@@ -2772,6 +2772,78 @@
return CHIP_NO_ERROR;
}
CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const PowerSource::Events::WiredFaultChange::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const PowerSource::Events::BatFaultChange::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
+ const PowerSource::Events::BatChargeFaultChange::DecodableType & value)
+{
+ DataModelLogger::LogString(label, indent, "{");
+ {
+ CHIP_ERROR err = DataModelLogger::LogValue("Current", indent + 1, value.current);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Current'");
+ return err;
+ }
+ }
+ {
+ CHIP_ERROR err = DataModelLogger::LogValue("Previous", indent + 1, value.previous);
+ if (err != CHIP_NO_ERROR)
+ {
+ DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'Previous'");
+ return err;
+ }
+ }
+ DataModelLogger::LogString(indent, "}");
+
+ return CHIP_NO_ERROR;
+}
+CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent,
const GeneralDiagnostics::Events::HardwareFaultChange::DecodableType & value)
{
DataModelLogger::LogString(label, indent, "{");
@@ -10571,6 +10643,27 @@
}
break;
}
+ case PowerSource::Id: {
+ switch (header.mPath.mEventId)
+ {
+ case PowerSource::Events::WiredFaultChange::Id: {
+ chip::app::Clusters::PowerSource::Events::WiredFaultChange::DecodableType value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("WiredFaultChange", 1, value);
+ }
+ case PowerSource::Events::BatFaultChange::Id: {
+ chip::app::Clusters::PowerSource::Events::BatFaultChange::DecodableType value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("BatFaultChange", 1, value);
+ }
+ case PowerSource::Events::BatChargeFaultChange::Id: {
+ chip::app::Clusters::PowerSource::Events::BatChargeFaultChange::DecodableType value;
+ ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value));
+ return DataModelLogger::LogValue("BatChargeFaultChange", 1, value);
+ }
+ }
+ break;
+ }
case GeneralDiagnostics::Id: {
switch (header.mPath.mEventId)
{
diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
index 1683e22..a3a71f6 100644
--- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
+++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h
@@ -166,6 +166,12 @@
static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::OtaSoftwareUpdateRequestor::Events::DownloadError::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::PowerSource::Events::WiredFaultChange::DecodableType & value);
+static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::PowerSource::Events::BatFaultChange::DecodableType & value);
+static CHIP_ERROR LogValue(const char * label, size_t indent,
+ const chip::app::Clusters::PowerSource::Events::BatChargeFaultChange::DecodableType & value);
+static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::GeneralDiagnostics::Events::HardwareFaultChange::DecodableType & value);
static CHIP_ERROR LogValue(const char * label, size_t indent,
const chip::app::Clusters::GeneralDiagnostics::Events::RadioFaultChange::DecodableType & value);
diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
index 7bb0ef4..bbe2189 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h
@@ -16338,6 +16338,9 @@
| * ClusterRevision | 0xFFFD |
|------------------------------------------------------------------------------|
| Events: | |
+| * WiredFaultChange | 0x0000 |
+| * BatFaultChange | 0x0001 |
+| * BatChargeFaultChange | 0x0002 |
\*----------------------------------------------------------------------------*/
/*