code: def config(self, settings):
          
          self.debug("()")
          # TODO synchronize access to vars
          try:
              self._device_id = settings['device_id']
  
              self._packet_timeout = settings.get(
                  'packet_wait_timeout',
                  self._packet_timeout
              )
              self._server_ip = settings.get('server_ip', self._server_ip)
              self._server_port = settings.get('server_port', self._server_port)
          except KeyError:
              raise SensorUpdateException("Key not in settings")
  
          if callable(self.on_config):
              try:
                  self.on_config(settings)
              except:
                  self.exception("Failed to update remote config")
                  raise SensorUpdateException("Remote config failed")
docs: Configuration has changed - config this module and lower layers
          (calls on_config - if set)
  
          :param settings: New configuration
          :type settings: dict
          :rtype: None
          :raises SensorUpdateException: Failed to update