'Retrieve groups of node.'

@ha.callback
def get(self, request, node_id):

    nodeid = int(node_id)
    hass = request.app['hass']
    network = hass.data.get(const.DATA_NETWORK)
    node = network.nodes.get(nodeid)
    if (node is None):
        return self.json_message('Node    not    found', HTTP_NOT_FOUND)
    groupdata = node.groups
    groups = {}
    for (key, value) in groupdata.items():
        groups[key] = {'associations': value.associations, 'association_instances': value.associations_instances, 'label': value.label, 'max_associations': value.max_associations}
    return self.json(groups)
