[coherence-dev] Help with Subscription

Sirtaj Singh Kang sirtaj at sirtaj.net
Sun Apr 12 15:18:49 CEST 2009


Hi,

I'm acquainting myself with the Coherence codebase by writing a simple  
av control point GUI with PyQt.

At the moment I am able to read and control various variables for  
rendering control and AV transport. However I am still having trouble  
understanding how subscriptions work.

1) Here is some code from the upnp inspector:

         service.subscribe_for_variable('Volume',  
callback=self.state_variable_change)

I am subscribing in a similar fashion but am never getting any events  
from my D-Link DSM-520 media player. Is there something I need to do  
to activate or poll the subscription?

2) Regarding state variable values:

         service = self.device.get_service_by_type('AVTransport')
         variable = service.get_state_variable('TransportState',  
instance=0)
         print variable.value

In this case here, value is always coming back empty. Is this also an  
async call, how do I listen for the result?

Sorry if these are dumb questions, I'd appreciate RTFM pointers.

-Taj.



More information about the coherence-dev mailing list