Esempio n. 1
0
 async def getNodeInfo(
     self, nodeId: int
 ) -> NetworkManagementProxy.NodeInfoCachedReport:
     self._nmSeq = self._nmSeq + 1
     cmd = NetworkManagementProxy.NodeInfoCachedGet(
         seqNo=self._nmSeq, maxAge=15, nodeID=nodeId
     )
     try:
         report = await self.sendAndReceive(
             cmd, NetworkManagementProxy.NodeInfoCachedReport
         )
     except asyncio.TimeoutError:
         return NetworkManagementProxy.NodeInfoCachedReport()
     return report
Esempio n. 2
0
 async def getMultiChannelCapability(
     self, nodeId: int, endpoint: int
 ) -> NetworkManagementProxy.MultiChannelCapabilityReport:
     self._nmSeq = self._nmSeq + 1
     cmd = NetworkManagementProxy.MultiChannelCapabilityGet(
         seqNo=self._nmSeq, nodeID=nodeId, endPoint=endpoint
     )
     try:
         report = await self.sendAndReceive(
             cmd, NetworkManagementProxy.MultiChannelCapabilityReport
         )
     except asyncio.TimeoutError:
         # No response
         return NetworkManagementProxy.MultiChannelCapabilityReport()
     return report
Esempio n. 3
0
 async def getFailedNodeList(self) -> list:
     self._nmSeq = self._nmSeq + 1
     cmd = NetworkManagementProxy.FailedNodeListGet(seqNo=self._nmSeq,)
     try:
         report = await self.sendAndReceive(
             cmd, NetworkManagementProxy.FailedNodeListReport
         )
     except asyncio.TimeoutError:
         return set()
     return report.failedNodeList
Esempio n. 4
0
async def test_getMultiChannelEndPoints(gateway: ZIPGateway):
    gateway.send = sendNop
    [endpoints, _] = await asyncio.gather(
        gateway.getMultiChannelEndPoints(1),
        runDelayed(
            gateway.commandReceived,
            NetworkManagementProxy.MultiChannelEndPointReport(
                individualEndPoints=2, aggregatedEndPoints=0),
        ),
    )
    assert endpoints == 2
Esempio n. 5
0
async def test_getMultiChannelCapability(gateway: ZIPGateway):
    gateway.send = sendNop
    [report, _] = await asyncio.gather(
        gateway.getMultiChannelCapability(1, 1),
        runDelayed(
            gateway.commandReceived,
            NetworkManagementProxy.MultiChannelCapabilityReport(),
        ),
    )
    assert isinstance(report,
                      NetworkManagementProxy.MultiChannelCapabilityReport)
Esempio n. 6
0
 async def getMultiChannelEndPoints(self, nodeId: int) -> int:
     self._nmSeq = self._nmSeq + 1
     cmd = NetworkManagementProxy.MultiChannelEndPointGet(
         seqNo=self._nmSeq, nodeID=nodeId
     )
     try:
         report = await self.sendAndReceive(
             cmd, NetworkManagementProxy.MultiChannelEndPointReport
         )
     except asyncio.TimeoutError:
         # No response
         return 0
     return report.individualEndPoints + report.aggregatedEndPoints
Esempio n. 7
0
 async def getNodeList(self) -> set:
     if self._nodes:
         # Return cached list
         return set(self._nodes.keys())
     self._nmSeq = self._nmSeq + 1
     cmd = NetworkManagementProxy.NodeListGet(seqNo=self._nmSeq)
     try:
         report = await self.sendAndReceive(
             cmd, NetworkManagementProxy.NodeListReport
         )
     except asyncio.TimeoutError:
         # No response
         return set()
     self._nodeId = report.nodeListControllerId
     self._nodes = {x: {} for x in report.nodes}
     return report.nodes
Esempio n. 8
0
 async def getNodeInfo(_):
     return NetworkManagementProxy.NodeInfoCachedReport(
         commandClass=bytes([COMMAND_CLASS_MULTI_CHANNEL_V2]))
Esempio n. 9
0
 async def getMultiChannelCapability(_, __):
     return NetworkManagementProxy.MultiChannelCapabilityReport(
         commandClass=b"")