|
| 1 | +This is the new generation of python-openzwave. |
| 2 | + |
| 3 | +python-openzwave is a python wrapper for the openzwave library. |
| 4 | + |
| 5 | +Install the needed tools |
| 6 | +======================== |
| 7 | +You must install mercurial and subversion to get sources of python-openzwave |
| 8 | +and openzwave. Look at the documentation of your Linux distribution to do them. |
| 9 | + |
| 10 | +You need cython (at least 0.14.1) to compile the python library (libopenzwave.pyx) |
| 11 | +You need sphinx and make to make the documentation |
| 12 | +To compile the openzwave library, look at their documentation. |
| 13 | + |
| 14 | +Get the sources |
| 15 | +=============== |
| 16 | +After that you can download the python-openzwave code : |
| 17 | +#hg clone https://code.google.com/p/python-openzwave/ |
| 18 | + |
| 19 | + |
| 20 | +Automatic installation |
| 21 | +====================== |
| 22 | +You can build python-openzwave with the install.sh script. |
| 23 | +#./install.sh |
| 24 | +If the build process succeed, run the following command to install |
| 25 | +#sudo python setup.py install |
| 26 | +That's all |
| 27 | +You can generate some documentation using the command : ./make_doc.sh |
| 28 | + |
| 29 | +Manual installation |
| 30 | +=================== |
| 31 | +-Retrieve the sources of openzwave : |
| 32 | +#svn checkout http://open-zwave.googlecode.com/svn/trunk/ openzwave |
| 33 | +-Build openzwave |
| 34 | +#cd openzwave/cpp/build/linux |
| 35 | +#make |
| 36 | +#cd ../../../.. |
| 37 | +-Build python-openzwave |
| 38 | +#python setup.py build |
| 39 | +-And install it if compilation succeed |
| 40 | +#sudo python setup.py install |
| 41 | +There is a copy of the openzwave's directory in /usr/local/share/python-openzwave |
| 42 | +API documentation is in /usr/local/share/doc/python-openzwave |
| 43 | + |
| 44 | +Installation on debian/ubuntu |
| 45 | +============================= |
| 46 | +You need to compile and install openzwave as a package to generate python-openzwave. |
| 47 | +After that, make the python-openzwave package |
| 48 | +#dpkg-buildpackage -rfakeroot |
| 49 | +You can now install the package with |
| 50 | +#sudo dpkg -i python-openzwave*.deb |
| 51 | +API documentation is in /usr/share/doc/python-openzwave |
| 52 | + |
| 53 | +Examples |
| 54 | +======== |
| 55 | +Examples have not been updated and they must |
| 56 | + |
| 57 | +How to contribute |
| 58 | +================= |
| 59 | +Get the sources |
| 60 | +#hg clone https://code.google.com/p/python-openzwave/ |
| 61 | + |
| 62 | +Developp, test, debug, test, ... :) |
| 63 | + |
| 64 | +When your modification is functional, you are ready to submit a patch |
| 65 | + |
| 66 | +Sync you repository : |
| 67 | +#hg pull |
| 68 | +#hg update |
| 69 | + |
| 70 | +Generate the patch |
| 71 | +#hgdiff > somewordstoexplainwhatthepatchdoes.patch |
| 72 | + |
| 73 | +As the code of python-openzwave is under developpment, submit atomic patches. |
| 74 | +Otherwise, you should have merge problems when syncing your repository. |
| 75 | + |
| 76 | +This will generate a file in the current directory. |
| 77 | +Send it to the developpers team. |
| 78 | + |
| 79 | +Static vs dynamic (or shared) |
| 80 | +============================= |
| 81 | +The openzwave (c++) lib needs to run as a singleton : it means that it |
| 82 | +MUST have only one instance of the manager running on your computer. |
| 83 | + |
| 84 | +There is 2 ways of linking libraries with a program : |
| 85 | +-static : includes a copy of the library in your binary program. This means |
| 86 | +that your program has its own instance of the library. This the way the |
| 87 | +install.sh runs. So you CAN'T have another program (like the control-panel) |
| 88 | +running when using the python-openzwave library |
| 89 | + |
| 90 | +-dynamic or shared : includes a link to the library in your binary program. |
| 91 | +This means that your program share the library with other programs. In this |
| 92 | +case, the instance is owned directly by the library. This the way the |
| 93 | +debian package works. So you CAN have another program running when |
| 94 | +using the python-openzwave library. Of course, this program MUST use |
| 95 | +the shared library. |
| 96 | + |
| 97 | +History |
| 98 | +======= |
| 99 | +The original script was from maarten damen : |
| 100 | +https://github.com/maartendamen/python-openzwave |
| 101 | +The openzwave package is now a wrapper to access Nodes, Network, Scenes, ... |
| 102 | +To update your old code, change "import openzwave" by |
| 103 | +"import libopenzwave" |
0 commit comments