@@ -8850,99 +8850,8 @@ public String toString() {
8850
8850
return output.toString();
8851
8851
}
8852
8852
}
8853
- public static class EnergyCalendarClusterDateStruct {
8854
- public @Nullable Integer year;
8855
- public @Nullable Integer month;
8856
- public @Nullable Integer day;
8857
- public @Nullable Integer dayOfWeek;
8858
- private static final long YEAR_ID = 0L;
8859
- private static final long MONTH_ID = 1L;
8860
- private static final long DAY_ID = 2L;
8861
- private static final long DAY_OF_WEEK_ID = 3L;
8862
-
8863
- public EnergyCalendarClusterDateStruct(
8864
- @Nullable Integer year,
8865
- @Nullable Integer month,
8866
- @Nullable Integer day,
8867
- @Nullable Integer dayOfWeek
8868
- ) {
8869
- this.year = year;
8870
- this.month = month;
8871
- this.day = day;
8872
- this.dayOfWeek = dayOfWeek;
8873
- }
8874
-
8875
- public StructType encodeTlv() {
8876
- ArrayList<StructElement> values = new ArrayList<>();
8877
- values.add(new StructElement(YEAR_ID, year != null ? new UIntType(year) : new NullType()));
8878
- values.add(new StructElement(MONTH_ID, month != null ? new UIntType(month) : new NullType()));
8879
- values.add(new StructElement(DAY_ID, day != null ? new UIntType(day) : new NullType()));
8880
- values.add(new StructElement(DAY_OF_WEEK_ID, dayOfWeek != null ? new UIntType(dayOfWeek) : new NullType()));
8881
-
8882
- return new StructType(values);
8883
- }
8884
-
8885
- public static EnergyCalendarClusterDateStruct decodeTlv(BaseTLVType tlvValue) {
8886
- if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
8887
- return null;
8888
- }
8889
- @Nullable Integer year = null;
8890
- @Nullable Integer month = null;
8891
- @Nullable Integer day = null;
8892
- @Nullable Integer dayOfWeek = null;
8893
- for (StructElement element: ((StructType)tlvValue).value()) {
8894
- if (element.contextTagNum() == YEAR_ID) {
8895
- if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
8896
- UIntType castingValue = element.value(UIntType.class);
8897
- year = castingValue.value(Integer.class);
8898
- }
8899
- } else if (element.contextTagNum() == MONTH_ID) {
8900
- if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
8901
- UIntType castingValue = element.value(UIntType.class);
8902
- month = castingValue.value(Integer.class);
8903
- }
8904
- } else if (element.contextTagNum() == DAY_ID) {
8905
- if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
8906
- UIntType castingValue = element.value(UIntType.class);
8907
- day = castingValue.value(Integer.class);
8908
- }
8909
- } else if (element.contextTagNum() == DAY_OF_WEEK_ID) {
8910
- if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
8911
- UIntType castingValue = element.value(UIntType.class);
8912
- dayOfWeek = castingValue.value(Integer.class);
8913
- }
8914
- }
8915
- }
8916
- return new EnergyCalendarClusterDateStruct(
8917
- year,
8918
- month,
8919
- day,
8920
- dayOfWeek
8921
- );
8922
- }
8923
-
8924
- @Override
8925
- public String toString() {
8926
- StringBuilder output = new StringBuilder();
8927
- output.append("EnergyCalendarClusterDateStruct {\n");
8928
- output.append("\tyear: ");
8929
- output.append(year);
8930
- output.append("\n");
8931
- output.append("\tmonth: ");
8932
- output.append(month);
8933
- output.append("\n");
8934
- output.append("\tday: ");
8935
- output.append(day);
8936
- output.append("\n");
8937
- output.append("\tdayOfWeek: ");
8938
- output.append(dayOfWeek);
8939
- output.append("\n");
8940
- output.append("}\n");
8941
- return output.toString();
8942
- }
8943
- }
8944
8853
public static class EnergyCalendarClusterDayStruct {
8945
- public Optional<ChipStructs.EnergyCalendarClusterDateStruct > date;
8854
+ public Optional<Long > date;
8946
8855
public Optional<Integer> daysOfWeek;
8947
8856
public ArrayList<ChipStructs.EnergyCalendarClusterTransitionStruct> transitions;
8948
8857
public Optional<Long> calendarID;
@@ -8952,7 +8861,7 @@ public static class EnergyCalendarClusterDayStruct {
8952
8861
private static final long CALENDAR_I_D_ID = 3L;
8953
8862
8954
8863
public EnergyCalendarClusterDayStruct(
8955
- Optional<ChipStructs.EnergyCalendarClusterDateStruct > date,
8864
+ Optional<Long > date,
8956
8865
Optional<Integer> daysOfWeek,
8957
8866
ArrayList<ChipStructs.EnergyCalendarClusterTransitionStruct> transitions,
8958
8867
Optional<Long> calendarID
@@ -8965,7 +8874,7 @@ public EnergyCalendarClusterDayStruct(
8965
8874
8966
8875
public StructType encodeTlv() {
8967
8876
ArrayList<StructElement> values = new ArrayList<>();
8968
- values.add(new StructElement(DATE_ID, date.<BaseTLVType>map((nonOptionaldate) -> nonOptionaldate.encodeTlv( )).orElse(new EmptyType())));
8877
+ values.add(new StructElement(DATE_ID, date.<BaseTLVType>map((nonOptionaldate) -> new UIntType(nonOptionaldate )).orElse(new EmptyType())));
8969
8878
values.add(new StructElement(DAYS_OF_WEEK_ID, daysOfWeek.<BaseTLVType>map((nonOptionaldaysOfWeek) -> new UIntType(nonOptionaldaysOfWeek)).orElse(new EmptyType())));
8970
8879
values.add(new StructElement(TRANSITIONS_ID, ArrayType.generateArrayType(transitions, (elementtransitions) -> elementtransitions.encodeTlv())));
8971
8880
values.add(new StructElement(CALENDAR_I_D_ID, calendarID.<BaseTLVType>map((nonOptionalcalendarID) -> new UIntType(nonOptionalcalendarID)).orElse(new EmptyType())));
@@ -8977,15 +8886,15 @@ public static EnergyCalendarClusterDayStruct decodeTlv(BaseTLVType tlvValue) {
8977
8886
if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
8978
8887
return null;
8979
8888
}
8980
- Optional<ChipStructs.EnergyCalendarClusterDateStruct > date = Optional.empty();
8889
+ Optional<Long > date = Optional.empty();
8981
8890
Optional<Integer> daysOfWeek = Optional.empty();
8982
8891
ArrayList<ChipStructs.EnergyCalendarClusterTransitionStruct> transitions = null;
8983
8892
Optional<Long> calendarID = Optional.empty();
8984
8893
for (StructElement element: ((StructType)tlvValue).value()) {
8985
8894
if (element.contextTagNum() == DATE_ID) {
8986
- if (element.value(BaseTLVType.class).type() == TLVType.Struct ) {
8987
- StructType castingValue = element.value(StructType .class);
8988
- date = Optional.of(ChipStructs.EnergyCalendarClusterDateStruct.decodeTlv(castingValue ));
8895
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt ) {
8896
+ UIntType castingValue = element.value(UIntType .class);
8897
+ date = Optional.of(castingValue.value(Long.class ));
8989
8898
}
8990
8899
} else if (element.contextTagNum() == DAYS_OF_WEEK_ID) {
8991
8900
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
0 commit comments