Skip to content

Commit

Permalink
Address PR comments and CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
tehampson committed Jul 17, 2024
1 parent 8962b03 commit 4781918
Show file tree
Hide file tree
Showing 10 changed files with 528 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<configurator>
<domain name="General"/>
<domain name="CHIP"/>
<struct name="EcosystemDeviceStruct" isFabricScoped="true" apiMaturity="provisional">
<cluster code="0x0750"/>
<item fieldId="0" name="DeviceName" type="char_string" optional="true" isFabricSensitive="true" length="64"/>
<item fieldId="1" name="DeviceNameLastEdit" type="epoch_us" optional="true" isFabricSensitive="true" default="0"/>
<item fieldId="2" name="BridgedEndpoint" type="endpoint_no" optional="true" isFabricSensitive="true"/>
<item fieldId="3" name="OriginalEndpoint" type="endpoint_no" optional="true" isFabricSensitive="true"/>
<item fieldId="4" name="DeviceTypes" array="true" type="DeviceTypeStruct" isFabricSensitive="true" minLength="1"/>
<item fieldId="5" name="UniqueLocationIDs" array="true" type="char_string" isFabricSensitive="true"/>
<item fieldId="5" name="UniqueLocationIDs" array="true" type="char_string" length="64" isFabricSensitive="true"/>
<item fieldId="6" name="UniqueLocationIDsLastEdit" type="epoch_us" isFabricSensitive="true" default="0"/>
</struct>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ TODO: Make these namespace enums global rather than defining them for each clust

<enum name="AreaTypeTag" type="enum8">
<cluster code="0x0150"/> <!-- Service Area Cluster -->
<cluster code="0x0750"/> <!-- Ecosystem Information Cluster -->
<!-- TODO: add Basic Information Cluster code="0x0028" -->

<item value="0x00" name="Aisle"/>
Expand Down
98 changes: 98 additions & 0 deletions src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -9199,6 +9199,104 @@ provisional cluster ContentAppObserver = 1296 {
provisional cluster EcosystemInformation = 1872 {
revision 1;

enum AreaTypeTag : enum8 {
kAisle = 0;
kAttic = 1;
kBackDoor = 2;
kBackYard = 3;
kBalcony = 4;
kBallroom = 5;
kBathroom = 6;
kBedroom = 7;
kBorder = 8;
kBoxroom = 9;
kBreakfastRoom = 10;
kCarport = 11;
kCellar = 12;
kCloakroom = 13;
kCloset = 14;
kConservatory = 15;
kCorridor = 16;
kCraftRoom = 17;
kCupboard = 18;
kDeck = 19;
kDen = 20;
kDining = 21;
kDrawingRoom = 22;
kDressingRoom = 23;
kDriveway = 24;
kElevator = 25;
kEnsuite = 26;
kEntrance = 27;
kEntryway = 28;
kFamilyRoom = 29;
kFoyer = 30;
kFrontDoor = 31;
kFrontYard = 32;
kGameRoom = 33;
kGarage = 34;
kGarageDoor = 35;
kGarden = 36;
kGardenDoor = 37;
kGuestBathroom = 38;
kGuestBedroom = 39;
kGuestRestroom = 40;
kGuestRoom = 41;
kGym = 42;
kHallway = 43;
kHearthRoom = 44;
kKidsRoom = 45;
kKidsBedroom = 46;
kKitchen = 47;
kLarder = 48;
kLaundryRoom = 49;
kLawn = 50;
kLibrary = 51;
kLivingRoom = 52;
kLounge = 53;
kMediaTVRoom = 54;
kMudRoom = 55;
kMusicRoom = 56;
kNursery = 57;
kOffice = 58;
kOutdoorKitchen = 59;
kOutside = 60;
kPantry = 61;
kParkingLot = 62;
kParlor = 63;
kPatio = 64;
kPlayRoom = 65;
kPoolRoom = 66;
kPorch = 67;
kPrimaryBathroom = 68;
kPrimaryBedroom = 69;
kRamp = 70;
kReceptionRoom = 71;
kRecreationRoom = 72;
kRestroom = 73;
kRoof = 74;
kSauna = 75;
kScullery = 76;
kSewingRoom = 77;
kShed = 78;
kSideDoor = 79;
kSideYard = 80;
kSittingRoom = 81;
kSnug = 82;
kSpa = 83;
kStaircase = 84;
kSteamRoom = 85;
kStorageRoom = 86;
kStudio = 87;
kStudy = 88;
kSunRoom = 89;
kSwimmingPool = 90;
kTerrace = 91;
kUtilityRoom = 92;
kWard = 93;
kWorkshop = 94;
}

struct HomeLocationStruct {
char_string<128> locationName = 0;
nullable int16s floorNumber = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12195,15 +12195,15 @@ public String toString() {
public static class EcosystemInformationClusterHomeLocationStruct {
public String locationName;
public @Nullable Integer floorNumber;
public @Nullable Object areaType;
public @Nullable Integer areaType;
private static final long LOCATION_NAME_ID = 0L;
private static final long FLOOR_NUMBER_ID = 1L;
private static final long AREA_TYPE_ID = 2L;

public EcosystemInformationClusterHomeLocationStruct(
String locationName,
@Nullable Integer floorNumber,
@Nullable Object areaType
@Nullable Integer areaType
) {
this.locationName = locationName;
this.floorNumber = floorNumber;
Expand All @@ -12214,7 +12214,7 @@ public StructType encodeTlv() {
ArrayList<StructElement> values = new ArrayList<>();
values.add(new StructElement(LOCATION_NAME_ID, new StringType(locationName)));
values.add(new StructElement(FLOOR_NUMBER_ID, floorNumber != null ? new IntType(floorNumber) : new NullType()));
values.add(new StructElement(AREA_TYPE_ID, areaType != null ? new AnyType(areaType) : new NullType()));
values.add(new StructElement(AREA_TYPE_ID, areaType != null ? new UIntType(areaType) : new NullType()));

return new StructType(values);
}
Expand All @@ -12225,7 +12225,7 @@ public static EcosystemInformationClusterHomeLocationStruct decodeTlv(BaseTLVTyp
}
String locationName = null;
@Nullable Integer floorNumber = null;
@Nullable Object areaType = null;
@Nullable Integer areaType = null;
for (StructElement element: ((StructType)tlvValue).value()) {
if (element.contextTagNum() == LOCATION_NAME_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.String) {
Expand All @@ -12238,9 +12238,9 @@ public static EcosystemInformationClusterHomeLocationStruct decodeTlv(BaseTLVTyp
floorNumber = castingValue.value(Integer.class);
}
} else if (element.contextTagNum() == AREA_TYPE_ID) {
if (element.value(BaseTLVType.class).type() == TLVType.Any) {
AnyType castingValue = element.value(AnyType.class);
areaType = castingValue.value(Object.class);
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
UIntType castingValue = element.value(UIntType.class);
areaType = castingValue.value(Integer.class);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import matter.tlv.TlvWriter
class EcosystemInformationClusterHomeLocationStruct(
val locationName: String,
val floorNumber: Int?,
val areaType: Any?,
val areaType: UInt?,
) {
override fun toString(): String = buildString {
append("EcosystemInformationClusterHomeLocationStruct {\n")
Expand Down Expand Up @@ -70,7 +70,7 @@ class EcosystemInformationClusterHomeLocationStruct(
}
val areaType =
if (!tlvReader.isNull()) {
tlvReader.getAny(ContextSpecificTag(TAG_AREA_TYPE))
tlvReader.getUInt(ContextSpecificTag(TAG_AREA_TYPE))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_AREA_TYPE))
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import matter.tlv.TlvWriter
class EcosystemInformationClusterHomeLocationStruct(
val locationName: String,
val floorNumber: Short?,
val areaType: Any?,
val areaType: UByte?,
) {
override fun toString(): String = buildString {
append("EcosystemInformationClusterHomeLocationStruct {\n")
Expand Down Expand Up @@ -70,7 +70,7 @@ class EcosystemInformationClusterHomeLocationStruct(
}
val areaType =
if (!tlvReader.isNull()) {
tlvReader.getAny(ContextSpecificTag(TAG_AREA_TYPE))
tlvReader.getUByte(ContextSpecificTag(TAG_AREA_TYPE))
} else {
tlvReader.getNull(ContextSpecificTag(TAG_AREA_TYPE))
null
Expand Down
103 changes: 103 additions & 0 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4781918

Please sign in to comment.