# Path: lib/devices.py
# def get_metrics_names(device_type):
#   """
#   Get metric names for a specific device type.
#   :return: list of metric names
#   """
#   metadata = [metadata for metadata in DEVICE_METADATA if metadata['device_name'] == device_type]
# 
#   if len(metadata) > 0:
#     metrics = metadata[0]['metrics']
#   else:
#     raise _DeviceNameNotFound("Could not find device name '%s' in metadata" % device_type)
# 
#   metric_names = []
#   for metric in metrics:
#     metric_names.append(metric['metric_name'])
# 
#   return metric_names


from abc import ABCMeta, abstractmethod
from lib.devices import get_metrics_names


class Connector(object):
  
    __metaclass__ = ABCMeta
  
    def __init__(self, publishers, buffer_size, step_size, device_name, device_port, device_mac=None):

      self.metrics = get_metrics_names(device_name)
      self.device = None
      self.device_port = device_port
      self.device_name = device_name
      self.device_mac = device_mac

      self.buffers = {metric: ConnectorBuffer(buffer_size, step_size, publishers[metric].publish) for metric in self.metrics}
      self.publishers = publishers

      
    @abstractmethod

# Path: lib/devices.py
# def get_metrics_names(device_type):
#   """
#   Get metric names for a specific device type.
#   :return: list of metric names
#   """
#   metadata = [metadata for metadata in DEVICE_METADATA if metadata['device_name'] == device_type]
# 
#   if len(metadata) > 0:
#     metrics = metadata[0]['metrics']
#   else:
#     raise _DeviceNameNotFound("Could not find device name '%s' in metadata" % device_type)
# 
#   metric_names = []
#   for metric in metrics:
#     metric_names.append(metric['metric_name'])
# 
#   return metric_names


# Path: lib/connectors/ConnectorInterface.py
from abc import ABCMeta, abstractmethod
from lib.devices import get_metrics_names



class Connector(object):
  
    __metaclass__ = ABCMeta
  
    def __init__(self, publishers, buffer_size, step_size, device_name, device_port, device_mac=None):

      self.metrics = get_metrics_names(device_name)
      self.device = None
      self.device_port = device_port
      self.device_name = device_name
      self.device_mac = device_mac

      self.buffers = {metric: ConnectorBuffer(buffer_size, step_size, publishers[metric].publish) for metric in self.metrics}
      self.publishers = publishers

      
    @abstractmethod

    def connect_device(self):