Exemplo n.º 1
0
 def __init__(self, logger):
     try:
         self.logger = logger
         self.sensorname = mks.getSensorName()
         self.config = mks.loadSensorConfig(self.sensorname)
         self.mksconfig = mks.loadMkSensorsConfig()
         self.senders = []
     except:
         self.logger.exception('SenderPlugin Init error')
         raise
Exemplo n.º 2
0
    def __init__(self, sendertype, logger):
        try:
            self.sendertype = sendertype
            self.logger = logger
            self.config = mks.loadSenderConfig(self.sendertype)
            self.mksconfig = mks.loadMkSensorsConfig()

            # Init log
            loglevel = mks.LOGSEVERITY[self.mksconfig.get('loglevel', 'WARNING')]
            mks.init_logging(self.logger, loglevel=loglevel)

        except:
            _LOGGER.exception('SenderPlugin Init error')
            raise