Ejemplo n.º 1
0
 def subscribe_for_variable(self, var_name, instance=0, callback=None, signal=False):
     variable = self.get_state_variable(var_name)
     if variable:
         if callback != None:
             if signal == True:
                 callback(variable)
                 louie.connect(callback, signal='Coherence.UPnP.StateVariable.%s.changed' % var_name, sender=self)
             else:
                 variable.subscribe(callback)
Ejemplo n.º 2
0
 def subscribe_for_variable(self,
                            var_name,
                            instance=0,
                            callback=None,
                            signal=False):
     variable = self.get_state_variable(var_name)
     if variable:
         if callback != None:
             if signal == True:
                 callback(variable)
                 louie.connect(
                     callback,
                     signal='Coherence.UPnP.StateVariable.%s.changed' %
                     var_name,
                     sender=self)
             else:
                 variable.subscribe(callback)