PyOhNet examples
|
21-10-2016, 12:06 PM
Post: #1
|
|||
|
|||
PyOhNet examples
Hi,
I am having a go at using PyOhNet. I want to build a basic control point for the Raspberry Pi and eventually a few other things. In the Test folder, the TestDeviceList.py just works. I cannot try TestControlEventing.py since there is no TestDvTestBasic.exe present, but I guess that doesnt matter. However, I'm having a little trouble setting up an example control point device and eventually eventing / subscriptions and invocing actions. From the TestDeviceList.py I can see how to get a devicelist, and I can do [device instance].Start(). Then I am a bit stuck. A few pointers how to get started would be much appreciated! And apologies if this should be obvious. Thanks in advance, Latka |
|||
22-10-2016, 11:41 AM
Post: #2
|
|||
|
|||
RE: PyOhNet examples
Here is a very simple test app.
It gets a Device List, and creates a Device with a given friendlyname. Then it creates a Proxy for the volume service. Then it invokes a VolumeDec action on the Device. All this works, but I don't seem to manage to make the event callback to work. The below two lines doesn't work. Code: volumeProxy.SetPropertyInitialEvent( callback ) Cheers, L Code: import PyOhNet as ohNet |
|||
24-10-2016, 02:00 PM
Post: #3
|
|||
|
|||
RE: PyOhNet examples
You need to subscribe to the service to receive events
...also callback does not receive the evented data - you have to request it The following should work Code: def callback(): |
|||
24-10-2016, 03:40 PM
Post: #4
|
|||
|
|||
RE: PyOhNet examples
Thank you good Sir!
I cannot believe I missed the Subscribe () bit. ;-) Also a huge thanks for pointing out the part about the callback. |
|||
« Next Oldest | Next Newest »
|