@@ -8501,99 +8501,8 @@ public String toString() {
8501
8501
return output.toString();
8502
8502
}
8503
8503
}
8504
- public static class EnergyCalendarClusterDateStruct {
8505
- public @Nullable Integer year;
8506
- public @Nullable Integer month;
8507
- public @Nullable Integer day;
8508
- public @Nullable Integer dayOfWeek;
8509
- private static final long YEAR_ID = 0L;
8510
- private static final long MONTH_ID = 1L;
8511
- private static final long DAY_ID = 2L;
8512
- private static final long DAY_OF_WEEK_ID = 3L;
8513
-
8514
- public EnergyCalendarClusterDateStruct(
8515
- @Nullable Integer year,
8516
- @Nullable Integer month,
8517
- @Nullable Integer day,
8518
- @Nullable Integer dayOfWeek
8519
- ) {
8520
- this.year = year;
8521
- this.month = month;
8522
- this.day = day;
8523
- this.dayOfWeek = dayOfWeek;
8524
- }
8525
-
8526
- public StructType encodeTlv() {
8527
- ArrayList<StructElement> values = new ArrayList<>();
8528
- values.add(new StructElement(YEAR_ID, year != null ? new UIntType(year) : new NullType()));
8529
- values.add(new StructElement(MONTH_ID, month != null ? new UIntType(month) : new NullType()));
8530
- values.add(new StructElement(DAY_ID, day != null ? new UIntType(day) : new NullType()));
8531
- values.add(new StructElement(DAY_OF_WEEK_ID, dayOfWeek != null ? new UIntType(dayOfWeek) : new NullType()));
8532
-
8533
- return new StructType(values);
8534
- }
8535
-
8536
- public static EnergyCalendarClusterDateStruct decodeTlv(BaseTLVType tlvValue) {
8537
- if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
8538
- return null;
8539
- }
8540
- @Nullable Integer year = null;
8541
- @Nullable Integer month = null;
8542
- @Nullable Integer day = null;
8543
- @Nullable Integer dayOfWeek = null;
8544
- for (StructElement element: ((StructType)tlvValue).value()) {
8545
- if (element.contextTagNum() == YEAR_ID) {
8546
- if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
8547
- UIntType castingValue = element.value(UIntType.class);
8548
- year = castingValue.value(Integer.class);
8549
- }
8550
- } else if (element.contextTagNum() == MONTH_ID) {
8551
- if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
8552
- UIntType castingValue = element.value(UIntType.class);
8553
- month = castingValue.value(Integer.class);
8554
- }
8555
- } else if (element.contextTagNum() == DAY_ID) {
8556
- if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
8557
- UIntType castingValue = element.value(UIntType.class);
8558
- day = castingValue.value(Integer.class);
8559
- }
8560
- } else if (element.contextTagNum() == DAY_OF_WEEK_ID) {
8561
- if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
8562
- UIntType castingValue = element.value(UIntType.class);
8563
- dayOfWeek = castingValue.value(Integer.class);
8564
- }
8565
- }
8566
- }
8567
- return new EnergyCalendarClusterDateStruct(
8568
- year,
8569
- month,
8570
- day,
8571
- dayOfWeek
8572
- );
8573
- }
8574
-
8575
- @Override
8576
- public String toString() {
8577
- StringBuilder output = new StringBuilder();
8578
- output.append("EnergyCalendarClusterDateStruct {\n");
8579
- output.append("\tyear: ");
8580
- output.append(year);
8581
- output.append("\n");
8582
- output.append("\tmonth: ");
8583
- output.append(month);
8584
- output.append("\n");
8585
- output.append("\tday: ");
8586
- output.append(day);
8587
- output.append("\n");
8588
- output.append("\tdayOfWeek: ");
8589
- output.append(dayOfWeek);
8590
- output.append("\n");
8591
- output.append("}\n");
8592
- return output.toString();
8593
- }
8594
- }
8595
8504
public static class EnergyCalendarClusterDayStruct {
8596
- public Optional<ChipStructs.EnergyCalendarClusterDateStruct > date;
8505
+ public Optional<Long > date;
8597
8506
public Optional<Integer> daysOfWeek;
8598
8507
public ArrayList<ChipStructs.EnergyCalendarClusterTransitionStruct> transitions;
8599
8508
public Optional<Long> calendarID;
@@ -8603,7 +8512,7 @@ public static class EnergyCalendarClusterDayStruct {
8603
8512
private static final long CALENDAR_I_D_ID = 3L;
8604
8513
8605
8514
public EnergyCalendarClusterDayStruct(
8606
- Optional<ChipStructs.EnergyCalendarClusterDateStruct > date,
8515
+ Optional<Long > date,
8607
8516
Optional<Integer> daysOfWeek,
8608
8517
ArrayList<ChipStructs.EnergyCalendarClusterTransitionStruct> transitions,
8609
8518
Optional<Long> calendarID
@@ -8616,7 +8525,7 @@ public EnergyCalendarClusterDayStruct(
8616
8525
8617
8526
public StructType encodeTlv() {
8618
8527
ArrayList<StructElement> values = new ArrayList<>();
8619
- values.add(new StructElement(DATE_ID, date.<BaseTLVType>map((nonOptionaldate) -> nonOptionaldate.encodeTlv( )).orElse(new EmptyType())));
8528
+ values.add(new StructElement(DATE_ID, date.<BaseTLVType>map((nonOptionaldate) -> new UIntType(nonOptionaldate )).orElse(new EmptyType())));
8620
8529
values.add(new StructElement(DAYS_OF_WEEK_ID, daysOfWeek.<BaseTLVType>map((nonOptionaldaysOfWeek) -> new UIntType(nonOptionaldaysOfWeek)).orElse(new EmptyType())));
8621
8530
values.add(new StructElement(TRANSITIONS_ID, ArrayType.generateArrayType(transitions, (elementtransitions) -> elementtransitions.encodeTlv())));
8622
8531
values.add(new StructElement(CALENDAR_I_D_ID, calendarID.<BaseTLVType>map((nonOptionalcalendarID) -> new UIntType(nonOptionalcalendarID)).orElse(new EmptyType())));
@@ -8628,15 +8537,15 @@ public static EnergyCalendarClusterDayStruct decodeTlv(BaseTLVType tlvValue) {
8628
8537
if (tlvValue == null || tlvValue.type() != TLVType.Struct) {
8629
8538
return null;
8630
8539
}
8631
- Optional<ChipStructs.EnergyCalendarClusterDateStruct > date = Optional.empty();
8540
+ Optional<Long > date = Optional.empty();
8632
8541
Optional<Integer> daysOfWeek = Optional.empty();
8633
8542
ArrayList<ChipStructs.EnergyCalendarClusterTransitionStruct> transitions = null;
8634
8543
Optional<Long> calendarID = Optional.empty();
8635
8544
for (StructElement element: ((StructType)tlvValue).value()) {
8636
8545
if (element.contextTagNum() == DATE_ID) {
8637
- if (element.value(BaseTLVType.class).type() == TLVType.Struct ) {
8638
- StructType castingValue = element.value(StructType .class);
8639
- date = Optional.of(ChipStructs.EnergyCalendarClusterDateStruct.decodeTlv(castingValue ));
8546
+ if (element.value(BaseTLVType.class).type() == TLVType.UInt ) {
8547
+ UIntType castingValue = element.value(UIntType .class);
8548
+ date = Optional.of(castingValue.value(Long.class ));
8640
8549
}
8641
8550
} else if (element.contextTagNum() == DAYS_OF_WEEK_ID) {
8642
8551
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
0 commit comments