'Add a device to its matching pool.'

def add_device(self, dev):

    dev_pool = self._create_pool_keys_from_dev(dev)
    if dev_pool:
        pool = self._find_pool(dev_pool)
        if (not pool):
            dev_pool['count'] = 0
            dev_pool['devices'] = []
            self.pools.append(dev_pool)
            self.pools.sort(key=(lambda item: len(item)))
            pool = dev_pool
        pool['count'] += 1
        pool['devices'].append(dev)
