Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keys in node dictionary in _nodes[] list of controller are different from Polyinterface #9

Open
Goose66 opened this issue Aug 1, 2020 · 1 comment

Comments

@Goose66
Copy link

Goose66 commented Aug 1, 2020

Specifically, nodedefid in PGC and node_def_id in polyinterface.

@Goose66
Copy link
Author

Goose66 commented Aug 1, 2020

The difference is introduced by the respective addNode() methods in the controller class:
Polyglot:

    def addNode(self, node):
        """
        Add a node to the NodeServer
        :param node: Dictionary of node settings. Keys: address, name, node_def_id, primary, and drivers are required.
        """
        LOGGER.info('Adding node {}({})'.format(node.name, node.address))
        message = {
            'addnode': {
                'nodes': [{
                    'address': node.address,
                    'name': node.name,
                    'node_def_id': node.id,
                    'primary': node.primary,
                    'drivers': node.drivers,
                    'hint': node.hint
                }]
            }
        }
        self.send(message)

PGC:

    def addNode(self, node):
        """
        Add a node to the NodeServer
        :param node: Dictionary of node settings. Keys: address, name, nodedefid, primary, and drivers are required.
        """
        LOGGER.info('Adding node {}({})'.format(node.name, node.address))
        message = {
            'addnode': {
                'address': node.address,
                'name': node.name,
                'nodedefid': node.id,
                'primary': node.primary,
                'drivers': node.drivers,
                'isController': True if hasattr(node, 'isController') else False
            }
        }
        if node.hint is not None:
            message['addnode']['hint'] = node.hint
        self.send(message)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant