code: def to_dict(self, minimal=False):
  
          
  
          data = collections.OrderedDict()
  
          if minimal:
  
              # In the minimal representation we just output the value
  
              data['value'] = self._to_python_type(self.value)
  
          else:
  
              # In the complete representation we output everything is needed to re-build the object
  
              data['value'] = self._to_python_type(self.value)
              data['desc'] = str(self.description)
              data['min_value'] = self._to_python_type(self.min_value)
              data['max_value'] = self._to_python_type(self.max_value)
              # We use our own thread-safe format for the unit
              data['unit'] = self.unit.to_string(format='threadsafe')
  
          return data
docs: Returns the representation for serialization