@@ -1351,8 +1351,12 @@ def _parseAttributePathTuple(self, pathTuple: typing.Union[
1351
1351
# Wildcard attribute id
1352
1352
typing .Tuple [int , typing .Type [ClusterObjects .Cluster ]],
1353
1353
# Concrete path
1354
- typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]]
1354
+ typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1355
+ # Directly specified attribute path
1356
+ ClusterAttribute .AttributePath
1355
1357
]):
1358
+ if isinstance (pathTuple , ClusterAttribute .AttributePath ):
1359
+ return pathTuple
1356
1360
if pathTuple == ('*' ) or pathTuple == ():
1357
1361
# Wildcard
1358
1362
return ClusterAttribute .AttributePath ()
@@ -1437,7 +1441,9 @@ async def Read(self, nodeid: int, attributes: typing.Optional[typing.List[typing
1437
1441
# Wildcard attribute id
1438
1442
typing .Tuple [int , typing .Type [ClusterObjects .Cluster ]],
1439
1443
# Concrete path
1440
- typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]]
1444
+ typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1445
+ # Directly specified attribute path
1446
+ ClusterAttribute .AttributePath
1441
1447
]]] = None ,
1442
1448
dataVersionFilters : typing .Optional [typing .List [typing .Tuple [int , typing .Type [ClusterObjects .Cluster ], int ]]] = None , events : typing .Optional [typing .List [
1443
1449
typing .Union [
@@ -1476,6 +1482,8 @@ async def Read(self, nodeid: int, attributes: typing.Optional[typing.List[typing
1476
1482
ReadAttribute(1, [ Clusters.BasicInformation ] ) -- case 5 above.
1477
1483
ReadAttribute(1, [ (1, Clusters.BasicInformation.Attributes.Location ] ) -- case 1 above.
1478
1484
1485
+ An AttributePath can also be specified directly by [chip.cluster.Attribute.AttributePath(...)]
1486
+
1479
1487
dataVersionFilters: A list of tuples of (endpoint, cluster, data version).
1480
1488
1481
1489
events: A list of tuples of varying types depending on the type of read being requested:
@@ -1543,7 +1551,9 @@ async def ReadAttribute(self, nodeid: int, attributes: typing.Optional[typing.Li
1543
1551
# Wildcard attribute id
1544
1552
typing .Tuple [int , typing .Type [ClusterObjects .Cluster ]],
1545
1553
# Concrete path
1546
- typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]]
1554
+ typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1555
+ # Directly specified attribute path
1556
+ ClusterAttribute .AttributePath
1547
1557
]]], dataVersionFilters : typing .Optional [typing .List [typing .Tuple [int , typing .Type [ClusterObjects .Cluster ], int ]]] = None ,
1548
1558
returnClusterObject : bool = False ,
1549
1559
reportInterval : typing .Optional [typing .Tuple [int , int ]] = None ,
@@ -1568,6 +1578,8 @@ async def ReadAttribute(self, nodeid: int, attributes: typing.Optional[typing.Li
1568
1578
ReadAttribute(1, [ Clusters.BasicInformation ] ) -- case 5 above.
1569
1579
ReadAttribute(1, [ (1, Clusters.BasicInformation.Attributes.Location ] ) -- case 1 above.
1570
1580
1581
+ An AttributePath can also be specified directly by [chip.cluster.Attribute.AttributePath(...)]
1582
+
1571
1583
returnClusterObject: This returns the data as consolidated cluster objects, with all attributes for a cluster inside
1572
1584
a single cluster-wide cluster object.
1573
1585
0 commit comments