code: def set_active_state(self, name, value):
          
          if name not in self.__active_states.keys():
              raise ValueError("Can not set unknown state '" + name + "'")
  
          if (isinstance(self.__active_states[name], int) and
                  isinstance(value, str)):
              # we get an update as str but current value is
              # an int, try to convert
              self.__active_states[name] = int(value)
          elif (isinstance(self.__active_states[name], float) and
                isinstance(value, str)):
              # we get an update as str but current value is
              # a float, try to convert
              self.__active_states[name] = float(value)
          else:
              self.__active_states[name] = value
docs: Set active state.