Beispiel #1
0
    async def loadNode(self, nodeId: int) -> list:
        """Load a node"""
        if nodeId == self.adapter.nodeId:
            # Ignore ourself
            return []
        nodes = []
        nodeInfo = await self.adapter.getNodeInfo(nodeId)
        node = Node(nodeId, self.adapter, list(nodeInfo.commandClass))
        nodes.append(node)
        node.addListener(self._storage)
        node.basicDeviceClass = nodeInfo.basicDeviceClass
        # node.flirs = ?
        node.genericDeviceClass = nodeInfo.genericDeviceClass
        # node.isFailed = ?
        node.listening = nodeInfo.listening
        node.specificDeviceClass = nodeInfo.specificDeviceClass
        self._nodes[node.nodeId] = node

        if node.supports(COMMAND_CLASS_MULTI_CHANNEL_V2):
            endpoints = await self.adapter.getMultiChannelEndPoints(nodeId)
            for endpoint in range(1, endpoints + 1):
                nodes.append(await self.loadEndPointNode(node, endpoint))
        return nodes
Beispiel #2
0
def test_genericdeviceclass(node: Node):
    assert node.genericDeviceClass == 0
    node.genericDeviceClass = 2
    assert node.genericDeviceClass == 2