@@ -1433,20 +1433,23 @@ def _parseEventPathTuple(self, pathTuple: typing.Union[
1433
1433
else :
1434
1434
raise ValueError ("Unsupported Attribute Path" )
1435
1435
1436
- async def Read (self , nodeid : int , attributes : typing .Optional [typing .List [typing .Union [
1437
- None , # Empty tuple, all wildcard
1438
- typing .Tuple [int ], # Endpoint
1439
- # Wildcard endpoint, Cluster id present
1440
- typing .Tuple [typing .Type [ClusterObjects .Cluster ]],
1441
- # Wildcard endpoint, Cluster + Attribute present
1442
- typing .Tuple [typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1443
- # Wildcard attribute id
1444
- typing .Tuple [int , typing .Type [ClusterObjects .Cluster ]],
1445
- # Concrete path
1446
- typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1447
- # Directly specified attribute path
1448
- ClusterAttribute .AttributePath
1449
- ]]] = None ,
1436
+ async def Read (
1437
+ self ,
1438
+ nodeid : int ,
1439
+ attributes : typing .Optional [typing .List [typing .Union [
1440
+ None , # Empty tuple, all wildcard
1441
+ typing .Tuple [int ], # Endpoint
1442
+ # Wildcard endpoint, Cluster id present
1443
+ typing .Tuple [typing .Type [ClusterObjects .Cluster ]],
1444
+ # Wildcard endpoint, Cluster + Attribute present
1445
+ typing .Tuple [typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1446
+ # Wildcard attribute id
1447
+ typing .Tuple [int , typing .Type [ClusterObjects .Cluster ]],
1448
+ # Concrete path
1449
+ typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1450
+ # Directly specified attribute path
1451
+ ClusterAttribute .AttributePath
1452
+ ]]] = None ,
1450
1453
dataVersionFilters : typing .Optional [typing .List [typing .Tuple [int , typing .Type [ClusterObjects .Cluster ], int ]]] = None , events : typing .Optional [typing .List [
1451
1454
typing .Union [
1452
1455
None , # Empty tuple, all wildcard
@@ -1461,10 +1464,11 @@ async def Read(self, nodeid: int, attributes: typing.Optional[typing.List[typing
1461
1464
# Concrete path
1462
1465
typing .Tuple [int , typing .Type [ClusterObjects .ClusterEvent ], int ]
1463
1466
]]] = None ,
1464
- eventNumberFilter : typing .Optional [int ] = None ,
1465
- returnClusterObject : bool = False , reportInterval : typing .Optional [typing .Tuple [int , int ]] = None ,
1466
- fabricFiltered : bool = True , keepSubscriptions : bool = False , autoResubscribe : bool = True ,
1467
- payloadCapability : int = TransportPayloadCapability .MRP_PAYLOAD ):
1467
+ eventNumberFilter : typing .Optional [int ] = None ,
1468
+ returnClusterObject : bool = False , reportInterval : typing .Optional [typing .Tuple [int , int ]] = None ,
1469
+ fabricFiltered : bool = True , keepSubscriptions : bool = False , autoResubscribe : bool = True ,
1470
+ payloadCapability : int = TransportPayloadCapability .MRP_PAYLOAD
1471
+ ):
1468
1472
'''
1469
1473
Read a list of attributes and/or events from a target node
1470
1474
@@ -1534,33 +1538,41 @@ async def Read(self, nodeid: int, attributes: typing.Optional[typing.List[typing
1534
1538
eventPaths = [self ._parseEventPathTuple (
1535
1539
v ) for v in events ] if events else None
1536
1540
1537
- ClusterAttribute .Read (future = future , eventLoop = eventLoop , device = device .deviceProxy , devCtrl = self ,
1541
+
1542
+ transaction = ClusterAttribute .AsyncReadTransaction (future , eventLoop , self , returnClusterObject )
1543
+ ClusterAttribute .Read (transaction ,
1538
1544
attributes = attributePaths , dataVersionFilters = clusterDataVersionFilters , events = eventPaths ,
1539
- eventNumberFilter = eventNumberFilter , returnClusterObject = returnClusterObject ,
1545
+ eventNumberFilter = eventNumberFilter ,
1540
1546
subscriptionParameters = ClusterAttribute .SubscriptionParameters (
1541
1547
reportInterval [0 ], reportInterval [1 ]) if reportInterval else None ,
1542
1548
fabricFiltered = fabricFiltered ,
1543
1549
keepSubscriptions = keepSubscriptions , autoResubscribe = autoResubscribe ).raise_on_error ()
1544
- return await future
1550
+ await future
1545
1551
1546
- async def ReadAttribute (self , nodeid : int , attributes : typing .Optional [typing .List [typing .Union [
1547
- None , # Empty tuple, all wildcard
1548
- typing .Tuple [int ], # Endpoint
1549
- # Wildcard endpoint, Cluster id present
1550
- typing .Tuple [typing .Type [ClusterObjects .Cluster ]],
1551
- # Wildcard endpoint, Cluster + Attribute present
1552
- typing .Tuple [typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1553
- # Wildcard attribute id
1554
- typing .Tuple [int , typing .Type [ClusterObjects .Cluster ]],
1555
- # Concrete path
1556
- typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1557
- # Directly specified attribute path
1558
- ClusterAttribute .AttributePath
1559
- ]]], dataVersionFilters : typing .Optional [typing .List [typing .Tuple [int , typing .Type [ClusterObjects .Cluster ], int ]]] = None ,
1560
- returnClusterObject : bool = False ,
1561
- reportInterval : typing .Optional [typing .Tuple [int , int ]] = None ,
1562
- fabricFiltered : bool = True , keepSubscriptions : bool = False , autoResubscribe : bool = True ,
1563
- payloadCapability : int = TransportPayloadCapability .MRP_PAYLOAD ):
1552
+ return transaction .GetReadResponse ()
1553
+
1554
+ async def ReadAttribute (
1555
+ self ,
1556
+ nodeid : int ,
1557
+ attributes : typing .Optional [typing .List [typing .Union [
1558
+ None , # Empty tuple, all wildcard
1559
+ typing .Tuple [int ], # Endpoint
1560
+ # Wildcard endpoint, Cluster id present
1561
+ typing .Tuple [typing .Type [ClusterObjects .Cluster ]],
1562
+ # Wildcard endpoint, Cluster + Attribute present
1563
+ typing .Tuple [typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1564
+ # Wildcard attribute id
1565
+ typing .Tuple [int , typing .Type [ClusterObjects .Cluster ]],
1566
+ # Concrete path
1567
+ typing .Tuple [int , typing .Type [ClusterObjects .ClusterAttributeDescriptor ]],
1568
+ # Directly specified attribute path
1569
+ ClusterAttribute .AttributePath
1570
+ ]]], dataVersionFilters : typing .Optional [typing .List [typing .Tuple [int , typing .Type [ClusterObjects .Cluster ], int ]]] = None ,
1571
+ returnClusterObject : bool = False ,
1572
+ reportInterval : typing .Optional [typing .Tuple [int , int ]] = None ,
1573
+ fabricFiltered : bool = True , keepSubscriptions : bool = False , autoResubscribe : bool = True ,
1574
+ payloadCapability : int = TransportPayloadCapability .MRP_PAYLOAD
1575
+ ):
1564
1576
'''
1565
1577
Read a list of attributes from a target node, this is a wrapper of DeviceController.Read()
1566
1578
@@ -1629,24 +1641,28 @@ async def ReadAttribute(self, nodeid: int, attributes: typing.Optional[typing.Li
1629
1641
else :
1630
1642
return res .attributes
1631
1643
1632
- async def ReadEvent (self , nodeid : int , events : typing .List [typing .Union [
1633
- None , # Empty tuple, all wildcard
1634
- typing .Tuple [str , int ], # all wildcard with urgency set
1635
- typing .Tuple [int , int ], # Endpoint,
1636
- # Wildcard endpoint, Cluster id present
1637
- typing .Tuple [typing .Type [ClusterObjects .Cluster ], int ],
1638
- # Wildcard endpoint, Cluster + Event present
1639
- typing .Tuple [typing .Type [ClusterObjects .ClusterEvent ], int ],
1640
- # Wildcard event id
1641
- typing .Tuple [int , typing .Type [ClusterObjects .Cluster ], int ],
1642
- # Concrete path
1643
- typing .Tuple [int , typing .Type [ClusterObjects .ClusterEvent ], int ]
1644
- ]], eventNumberFilter : typing .Optional [int ] = None ,
1645
- fabricFiltered : bool = True ,
1646
- reportInterval : typing .Optional [typing .Tuple [int , int ]] = None ,
1647
- keepSubscriptions : bool = False ,
1648
- autoResubscribe : bool = True ,
1649
- payloadCapability : int = TransportPayloadCapability .MRP_PAYLOAD ):
1644
+ async def ReadEvent (
1645
+ self ,
1646
+ nodeid : int ,
1647
+ events : typing .List [typing .Union [
1648
+ None , # Empty tuple, all wildcard
1649
+ typing .Tuple [str , int ], # all wildcard with urgency set
1650
+ typing .Tuple [int , int ], # Endpoint,
1651
+ # Wildcard endpoint, Cluster id present
1652
+ typing .Tuple [typing .Type [ClusterObjects .Cluster ], int ],
1653
+ # Wildcard endpoint, Cluster + Event present
1654
+ typing .Tuple [typing .Type [ClusterObjects .ClusterEvent ], int ],
1655
+ # Wildcard event id
1656
+ typing .Tuple [int , typing .Type [ClusterObjects .Cluster ], int ],
1657
+ # Concrete path
1658
+ typing .Tuple [int , typing .Type [ClusterObjects .ClusterEvent ], int ]
1659
+ ]], eventNumberFilter : typing .Optional [int ] = None ,
1660
+ fabricFiltered : bool = True ,
1661
+ reportInterval : typing .Optional [typing .Tuple [int , int ]] = None ,
1662
+ keepSubscriptions : bool = False ,
1663
+ autoResubscribe : bool = True ,
1664
+ payloadCapability : int = TransportPayloadCapability .MRP_PAYLOAD
1665
+ ):
1650
1666
'''
1651
1667
Read a list of events from a target node, this is a wrapper of DeviceController.Read()
1652
1668
0 commit comments