diff --git a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml index 481a6e3d652a05..33225e90f2a08a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/switch-cluster.xml @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + CHIP Switch @@ -27,20 +27,51 @@ limitations under the License. Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. - - + + number of positions current position multi press max + + Switch Latched + + + + Initial Press + + + + Long Press + + + + Short Release + + + + Long Release + + + + MultiPress Ongoing + + + + + MultiPress Complete + + + + - - - - - + + + + + diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 101c6349e9675d..64e6d926b670b8 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -10185,6 +10185,118 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = None + class Events: + @dataclass + class SwitchLatched(ClusterEventDescriptor): + cluster_id: typing.ClassVar[int] = 0x003B + event_id: typing.ClassVar[int] = 0x00000000 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="newPosition", Tag=0, Type=uint), + ]) + + newPosition: 'uint' = None + + @dataclass + class InitialPress(ClusterEventDescriptor): + cluster_id: typing.ClassVar[int] = 0x003B + event_id: typing.ClassVar[int] = 0x00000001 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="newPosition", Tag=0, Type=uint), + ]) + + newPosition: 'uint' = None + + @dataclass + class LongPress(ClusterEventDescriptor): + cluster_id: typing.ClassVar[int] = 0x003B + event_id: typing.ClassVar[int] = 0x00000002 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="newPosition", Tag=0, Type=uint), + ]) + + newPosition: 'uint' = None + + @dataclass + class ShortRelease(ClusterEventDescriptor): + cluster_id: typing.ClassVar[int] = 0x003B + event_id: typing.ClassVar[int] = 0x00000003 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="previousPosition", Tag=0, Type=uint), + ]) + + previousPosition: 'uint' = None + + @dataclass + class LongRelease(ClusterEventDescriptor): + cluster_id: typing.ClassVar[int] = 0x003B + event_id: typing.ClassVar[int] = 0x00000004 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="previousPosition", Tag=0, Type=uint), + ]) + + previousPosition: 'uint' = None + + @dataclass + class MultiPressOngoing(ClusterEventDescriptor): + cluster_id: typing.ClassVar[int] = 0x003B + event_id: typing.ClassVar[int] = 0x00000005 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="newPosition", Tag=0, Type=uint), + ClusterObjectFieldDescriptor( + Label="currentNumberOfPressesCounted", Tag=1, Type=uint), + ]) + + newPosition: 'uint' = None + currentNumberOfPressesCounted: 'uint' = None + + @dataclass + class MultiPressComplete(ClusterEventDescriptor): + cluster_id: typing.ClassVar[int] = 0x003B + event_id: typing.ClassVar[int] = 0x00000006 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor( + Label="newPosition", Tag=0, Type=uint), + ClusterObjectFieldDescriptor( + Label="totalNumberOfPressesCounted", Tag=1, Type=uint), + ]) + + newPosition: 'uint' = None + totalNumberOfPressesCounted: 'uint' = None + @dataclass class AdministratorCommissioning(Cluster): diff --git a/third_party/zap/repo b/third_party/zap/repo index 55a6cc8fe1dfcc..8abf57ba70b213 160000 --- a/third_party/zap/repo +++ b/third_party/zap/repo @@ -1 +1 @@ -Subproject commit 55a6cc8fe1dfcc76598a8b14f532c5054ef689ab +Subproject commit 8abf57ba70b2134ac387968d823a71a361fe6ae2 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 468d9b5c0b6899..7edbb70078802c 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 @@ -7453,6 +7453,254 @@ namespace Commands { } // namespace Commands namespace Events { +namespace SwitchLatched { +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::kNewPosition)), newPosition)); + 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) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kNewPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, newPosition)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace SwitchLatched. +namespace InitialPress { +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::kNewPosition)), newPosition)); + 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) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kNewPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, newPosition)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace InitialPress. +namespace LongPress { +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::kNewPosition)), newPosition)); + 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) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kNewPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, newPosition)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace LongPress. +namespace ShortRelease { +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::kPreviousPosition)), previousPosition)); + 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) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kPreviousPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, previousPosition)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace ShortRelease. +namespace LongRelease { +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::kPreviousPosition)), previousPosition)); + 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) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kPreviousPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, previousPosition)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace LongRelease. +namespace MultiPressOngoing { +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::kNewPosition)), newPosition)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCurrentNumberOfPressesCounted)), + currentNumberOfPressesCounted)); + 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) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kNewPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, newPosition)); + break; + case to_underlying(Fields::kCurrentNumberOfPressesCounted): + ReturnErrorOnFailure(DataModel::Decode(reader, currentNumberOfPressesCounted)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace MultiPressOngoing. +namespace MultiPressComplete { +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::kNewPosition)), newPosition)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kTotalNumberOfPressesCounted)), + totalNumberOfPressesCounted)); + 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) + { + VerifyOrReturnError(TLV::IsContextTag(reader.GetTag()), CHIP_ERROR_INVALID_TLV_TAG); + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kNewPosition): + ReturnErrorOnFailure(DataModel::Decode(reader, newPosition)); + break; + case to_underlying(Fields::kTotalNumberOfPressesCounted): + ReturnErrorOnFailure(DataModel::Decode(reader, totalNumberOfPressesCounted)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace MultiPressComplete. } // namespace Events } // namespace Switch 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 8bc9014e7dbccd..a46eec6a7955f4 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 @@ -11841,6 +11841,245 @@ struct TypeInfo }; } // namespace ClusterRevision } // namespace Attributes +namespace Events { +namespace SwitchLatched { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000000; + +enum class Fields +{ + kNewPosition = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace SwitchLatched +namespace InitialPress { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000001; + +enum class Fields +{ + kNewPosition = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace InitialPress +namespace LongPress { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000002; + +enum class Fields +{ + kNewPosition = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace LongPress +namespace ShortRelease { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000003; + +enum class Fields +{ + kPreviousPosition = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t previousPosition; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t previousPosition; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace ShortRelease +namespace LongRelease { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000004; + +enum class Fields +{ + kPreviousPosition = 0, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t previousPosition; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t previousPosition; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace LongRelease +namespace MultiPressOngoing { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000005; + +enum class Fields +{ + kNewPosition = 0, + kCurrentNumberOfPressesCounted = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + uint8_t currentNumberOfPressesCounted; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + uint8_t currentNumberOfPressesCounted; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace MultiPressOngoing +namespace MultiPressComplete { +static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; +static constexpr EventId kEventId = 0x00000006; + +enum class Fields +{ + kNewPosition = 0, + kTotalNumberOfPressesCounted = 1, +}; + +struct Type +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + uint8_t totalNumberOfPressesCounted; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +struct DecodableType +{ +public: + static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; } + static constexpr EventId GetEventId() { return kEventId; } + static constexpr ClusterId GetClusterId() { return Clusters::Switch::Id; } + + uint8_t newPosition; + uint8_t totalNumberOfPressesCounted; + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +} // namespace MultiPressComplete +} // namespace Events } // namespace Switch namespace AdministratorCommissioning { // Need to convert consumers to using the new enum classes, so we