diff --git a/.gitignore b/.gitignore index d8975633..1bfc589d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.o *.pyc *.log +.idea /openzwave/ build/ dists/ @@ -25,8 +26,9 @@ examples/pyozw.db examples/zwcfg_* examples/zwscene.xml examples/zwbutton.xml +examples/pyozw.sqlite install.files -src-lib/libopenzwave.so +src-lib/libopenzwave*.so src-lib/libopenzwave.egg-info/ src-lib/libopenzwave/libopenzwave.cpp src-api/openzwave.egg-info/ @@ -39,8 +41,30 @@ debian/files debian/*.debhelper debian/*.debhelper.log debian/*.substvars +debian/python-openzwave/ debian/python-openzwave-api/ debian/python-openzwave-doc/ debian/python-openzwave-lib/ debian/python-openzwave-manager/ debian/python-openzwave-web/ +debian/debhelper-build-stamp +debian/python3-openzwave/ +pybind +lib.txt +log.txt +pyozw.sqlite +venv2/ +venv3/ +.pybuild/ +.pypirc +open-zwave-master/ +openzwave-git/ +openzwave-embed/ +tmp/ +dist/ +docs/html/ +docs/joomla/ +libopenzwave*.so +.pipcache +options.xml +dynamic.dockerfile diff --git a/.travis.yml b/.travis.yml index 32b8cff9..0b787937 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,24 +1,39 @@ -language: cpp -cache: - - apt +language: python +sudo: required python: - - "2.7" -# - "3.2" -# - "3.3" -# - "3.4" -install: -# - env -# - make pip - - make update - - make build - - sudo make install -# command to run tests -script: - - make autobuild-tests -# package dependencies +- '3.5' +env: + matrix: + - DOCKER_BASE=ubuntu:latest + - DOCKER_BASE=debian:latest + - DOCKER_BASE=i386/ubuntu:xenial + #~ - DOCKER_BASE=arm32v7/ubuntu:xenial + #~ - DOCKER_BASE=arm64v8/ubuntu:xenial + #~ - DOCKER_BASE=resin/rpi-raspbian:latest + - DOCS="true" + global: + - secure: "LdXdleVnh5s6HRPWLh3LcYo+s2IpvxwjFOQSJdMM1/svpstBu+pqAy6y6ivn4u7RUgG1Hva+iImMmqoBw4MUl+CTvK1RTLsOFFa0z37XSdWJbHSA+SmH9Dith1iHjaHTnkMNRaJugfJoLm2RXsii4ksMZcncm0gQLChyH+kxzX+ytoz8ofKk6f8zKqa+8YYhTlsV+BtnaEJOli22FKmLI8glOYiJpJj9UG8xQkwzNlIxR0PNZxvXnfVLeIw4sF9R3h6fkM/PZGbEfn1roZYDsdepl6SwumfmY+gOB74Ze7oObeJjmXA1HC8NSrsivIDB+gfAzKE01Jk2LyNZ+T2u7Zlqjf9pV0HhkYuBhc38BkpeBKkMKliJwuSIwEdsGWR71rC7VmegSbKp/I3Ev3oWy3h0k/J/W4SIxhN4mc8DAhaIC5TPdMHHTBSWyh494PEjX5zrinq4w6K7qjWpUB6rEUpHTHIE/F5f46QRTwFb5bhusIH8Hjo7GceEtYy1h8vGJ16GnAqvvrBJBU5QKCSfJicMiOUPELl3iD86vOdrJyYiiU+jALvgQH70D7KA9igIGRjmOdv71D09bEOVAYSNOaBsiCtyZqyx8kDMSETJ92VwhLO/aKazoGqlgiI8bEqSHA7Tjah6vyeTdnZeWRg7Fh2RM4W1T7lkXqzICNbUdW0=" +services: +- docker before_install: - #- env - #- sudo -E env - - sudo apt-get update -y -qq - - sudo -E make python-deps - - sudo -E make autobuild-deps +- if [[ "${DOCKER_BASE}x" != "x" ]]; then + docker pull ${DOCKER_BASE}; + fi +- if [[ "${DOCS}" == "true" ]]; then + sudo apt-get update; + sudo make common-deps; + fi +script: +- if [[ "${DOCKER_BASE}x" != "x" ]]; then + sed -e "s#ubuntu:latest#${DOCKER_BASE}#" Dockerfile > dynamic.dockerfile && docker build -t python-openzwave -f dynamic.dockerfile .; + fi +- if [[ "${DOCS}" == "true" ]]; then + set -e; + make doc-deps; + make install-api; + cd docs; + make html; + cd ..; + pip3 install doctr; + doctr deploy --built-docs docs/_build/html .; + fi diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 57e1c32f..1b504fd0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,14 +1,175 @@ - Changelog ********* -Known bugs +python_openzwave 0.4.18.x: + * Fix python 2.7/appveyor + + * Add serial port auto-detection + +python_openzwave 0.4.17.x: + * Add wheels for Windows + +python_openzwave 0.4.16.x: + * Fix appveyor build for windows + +python_openzwave 0.4.15.x: + * Update embeded package + +python_openzwave 0.4.14.x: + * Use Cython 0.28.6 + + * Update embeded package + +python_openzwave 0.4.12.x: + * Improve support Windows + + * COMMAND_CLASS_ZWAVE_PLUS_INFO renamed to + COMMAND_CLASS_ZWAVEPLUS_INFO + + * Update thermostat + + * Update embeded package + +python_openzwave 0.4.11.x: + * Update embeded package + +python_openzwave 0.4.10.x: + * Improve support Windows in pip + + * Improve tests Windows + + * Update contructors for scenes and groups + +python_openzwave 0.4.9.x: + * Improve support Windows in pip + + * Update tests + +python_openzwave 0.4.6.x: + * First try to support Windows in pip + +python_openzwave 0.4.5.x: + * Fix bug in node statistics and add test. + + * Update Makefile to build flavor dev + + * Update pyozw_check. + + * Update default flavor : check cython is here before choosing + shared + + * Fix controller.update_ozw_config when directory isn't writable + +python_openzwave 0.4.4.x: + * Add new options to pyozw_check to list nodes on network. + +python_openzwave 0.4.3.x: + * Fix bug in default flavor. + +python_openzwave 0.4.1.x: + * Update the default flavor : try to use a precompiled library. + If can't find one, use the embeded package. + + * Add method to controller to get new config from github. + +python_openzwave 0.4.0.x: + + * New installation process via pip + + * Update your install_requires : both libopenzwave, openzwave and + the manager are merged in python_openzwave package on pypi. Don't + need to update your imports in code. + + * There will be major updates in the next releases, it's safe to + use python_openzwave>0.4.0 and python_openzwave<0.5 in your + requires. + + * Remove old versions of libopenzwave and openzwave before you + update your installation with new pip process ... or not. + + * You can use the old installation process (via github), it's the + one I use to develop. + + * Installation via archive method is no longer suppored (no + release for 0.4.0). Use pip instead with --flavor embed option. - * reloader problem : the network stop/start every time the app is - realoaded. But in this case, the process terminates normally. But - there seems to be 2 running instances of the network. + * Default mode is embed now. + + * Update config path discovery : check for 'device_classes.xml' + in /etc/openzwave/, /usr/local/etc/openzwave/ and finally in + ozw_config in python_openzwave module. + + * Add flavor : different ways of building and installing + openzwave / python_openzwave. + + * Add infos on flavor / build date to getPythonLibraryVersion + + * Improve installation on micro machines : embed_shared build and + install openzwave/python_openzwave in 8 minutes on a raspberry pi + 3 + + * Add ozwdev and ozwdev_shared flavors : use openzwave dev branch + instead of master + + * Rename to COMMAND_CLASS_MULTI_CHANNEL_V2 to + COMMAND_CLASS_MULTI_INSTANCE/CHANNEL + + * Add tests for c++ library sync + + * Add door locks helpers + + * Add helpers for config parameters + + * Add data_items to value's dict + +python-openzwave 0.3.3: + + * Openzwave update + + * Update values getter in nodes. See #70 + + * Fix setvalue for string types in python3 + +python-openzwave 0.3.2: + + * Openzwave update + + * Add thermostat + + * Add patch from https://github.com/ebisso/python- + openzwave/commit/8776daccc730cb5d7f71a178e9e0cc1d191ad115 + + * Can compile dynamically + +python-openzwave 0.3.1: + + * Fix bugs and openzwave update + +python-openzwave 0.3.0: + + * Fix bugs and openzwave update + +python-openzwave 0.3.0-beta8: + + * Add multi instance support + + * Update GROUP notification : please update your code to add the + new parameter + + * Update VALUE_REMOVED notification : please update your code to + add the new parameter + + * Improve unicode : you may need to delete your old config file + + * Add Python 3 support + + * Improve controllers_command : add a lock and a way to retrieve + current status + + * Add support for RGB bulbs python-openzwave 0.3.0-beta3: + * Add security rewrite support. See https://groups.google.com/foru m/#!msg/openzwave/cPjrvJJaESY/toK7QxEgRn0J @@ -35,9 +196,11 @@ python-openzwave 0.3.0-beta3: openzwave c++ ressources python-openzwave 0.3.0-beta2: + * Move to OpenZWave git organisation python-openzwave 0.3.0-beta1: + * Add pyozwman script : after installing you can launch it wit : Usage: ozwsh [--device=/dev/ttyUSB0] [--log=Debug] ... diff --git a/DEVEL.txt b/DEVEL.txt index 5c737bc0..f2d8f06b 100644 --- a/DEVEL.txt +++ b/DEVEL.txt @@ -1,4 +1,3 @@ - Developers information ********************** @@ -6,166 +5,54 @@ Developers information How to develop for python-openzwave =================================== -Get the sources - - git clone https://github.com/OpenZWave/python-openzwave - -You must now install python-openzwave in develop mode - - make develop - -Your password will be asked (by sudo) for installing eggs in your -local directory. - -Develop, test, debug, test, ... :) - -Update the documentation if needed. You surely found the documentation -useful, so please keep it up to date. - -You can create an account on travis or docker to run the tests. - -At last but not least, submit your request. +Fork the project on Github. +Get the sources : -How to develop for libopenzwave (was python-openzwave-lib) -========================================================== + git clone https://github.com/yourname/python-openzwave -After updating the pyx, you need to reinstall it. Otherwise, your -changes will not be applied : +You can install all the dependances to develop for python-openzwave +using the command : - make develop + sudo make developer-deps +You must now install python-openzwave in develop mode. Depending on +which python version you prefer, use : -Tests -===== + make venv2-dev -Travis-ci, Docker Hub, nosetests and pylint are used to test quality -of code. There reports are here : +or - * Docker : https://registry.hub.docker.com/u/bibi21000/python- - openzwave/ + make venv2-dev - * Travis : https://travis-ci.org/bibi21000/python-openzwave +Keep in mind that your updates must be python 2 / python 3 compatible. - * Nosetests report - - * Coverage report - - * Pylint report +Develop, test, debug, test, ... :) -Some tests don't need a ZWave Stick to be launched, so they can be run -on the autobuilders (travis, docker, ...). Place them in the autobuild -directory. +Update the documentation if needed. You surely found the documentation +useful, so please keep it up to date. -Some tests need manual operations (ie to add a node, to remove one, -...). For example, to test the remove node, use : +It a good idea to add automatic tests. - export MANUALSKIP='False' && /usr/local/bin/nosetests --verbosity=2 tests/api/test_controller_command.py -m test_150 && unset MANUALSKIP - test_150_command_remove_node_and_wait_for_user (tests.api.test_controller_command.TestControllerCommand) ... ok +Launch the full test suite (for python 2 and python 3) : - ---------------------------------------------------------------------- - Ran 1 test in 16.031s + make venv-tests - OK +At last but not least, submit your request with the result of tests in +the comment. -You should push the inclusion button of the node before the end of the -test. +If you don't follow the previous steps, your PR will be refused or +letting in pending state until I've got time to test it. Documentation ============= -Documentation is managed with sphinx. Don't utpdate txt files (README, -INSTALL, ...), update the RST sources in docs. Use the following -commands to generate all docs files (txt, html and joomla) - -You need to have installed python-openzave (in either develop or -install mode) before generating the documentation. - - make docs - - -Static vs dynamic (or shared) -============================= - -The openzwave (c++) lib needs to run as a singleton : it means that it -MUST have only one instance of the manager running on your computer. - -There is 2 ways of linking libraries with a program : - - * static : includes a copy of the library in your binary program. - This means that your program has its own instance of the library. - This the way the install.sh runs. So you CAN'T have another - program (like the control-panel) running when using the python- - openzwave library - - * dynamic or shared : includes a link to the library in your - binary program. This means that your program share the library - with other programs. In this case, the instance is owned directly - by the library. This the way the debian package works. So you CAN - have another program running when using the python-openzwave - library. Of course, this program MUST use the shared library too. - - -About sudo -========== - -If you are like me and don't like root (and sudo), you can use the -following tip to install packages via pip : - -Look at your python local library, it should looks like : - - ls -lisa /usr/local/lib/python2.7/dist-packages/ - total 2428 - 1445174 12 drwxrwsr-x 115 root staff 12288 avril 9 21:35 . - 1445172 4 drwxrwsr-x 4 root staff 4096 mai 2 2014 .. - 1457164 4 drwxr-sr-x 5 root staff 4096 nov. 26 2013 actdiag - 1715480 4 drwxr-sr-x 2 root staff 4096 nov. 26 2013 actdiag-0.5.1.egg-info - 1457163 4 -rw-r--r-- 1 root staff 1004 nov. 26 2013 actdiag_sphinxhelper.py - 1457172 4 -rw-r--r-- 1 root staff 620 nov. 26 2013 actdiag_sphinxhelper.pyc - .... - -So, add your common user to the staff group : - - sudo usermod -a -G staff userName - -Add the write right to the group staff - - sudo chmod -Rf g+w /usr/local/lib/python2.7/dist-packages/ - -And now, it's time log off and log on. Groups are checked when you -open the session. - -You can now install your packages without sudo. - - -Python3 and virtualenv -====================== - -Python 3 is actually not supported. - -A branch (python3) has been created with a special Dockerfile. It -build python-openzwave and launch some tests. This branch is -automatically merged from master at "make commit". - -So please, do not directly push under python3 branch. Make your -developments under master or another branch. - -It's important for me have python2/python3 compatibilty in the master -branch. cython can help for this : -http://docs.cython.org/src/tutorial/strings.html - -The Makefile sill try to automatically configure your version of -python (running python --version). - -If you want to install python-openzwave in a python virtual -environnement, you should use something like : - - make VIRTUAL_ENV=/path/to/my/venv ... +First, install the dependances : -If you use python 3 and your python executable is called python3 : + sudo make doc-deps - make PYTHON_EXEC=python3 ... +Documentation is managed with sphinx. -You can also put these variables in a CONFIG.make file instead of -passing them to the command line +Don't update txt and rst files (README, INSTALL, ...) in the root +directory, update the RST sources in docs. diff --git a/Dockerfile b/Dockerfile index 675e0c0e..0fa0cc47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,15 @@ -FROM debian:wheezy +FROM ubuntu:latest MAINTAINER bibi21000 -ADD . /home/docker-py2 -WORKDIR /home/docker-py2 -RUN apt-get update && apt-get install -y make python -RUN make python-deps -RUN make autobuild-deps -RUN env -RUN make update -RUN make build -RUN make install -RUN make autobuild-tests +ENV PYOZW_DOCKER 1 +RUN apt-get update && apt-get dist-upgrade -y >/dev/null +RUN apt-get install -y --no-install-recommends make sudo apt-utils >/dev/null +ADD . /home/pyozw +WORKDIR /home/pyozw +RUN make docker-deps >/dev/null +RUN make openzwave.gzip >/dev/null +RUN make venv-dev-autobuild-tests +#RUN make venv-pypi-autobuild-tests +#RUN apt-get install --force-yes -y pkg-config >/dev/null +#RUN make venv-git_shared-autobuild-tests +#RUN apt-get remove --force-yes -y pkg-config >/dev/null +RUN make venv-pypilive-autobuild-tests diff --git a/EXAMPLES.txt b/EXAMPLES.txt index 011ab2d0..a219c666 100644 --- a/EXAMPLES.txt +++ b/EXAMPLES.txt @@ -1,4 +1,3 @@ - python-openzwave **************** @@ -8,14 +7,14 @@ You need to install and build python-openzwave to test examples. pyozwman ======== -A shell manager for your ZWave network : *PyOzwMan documentation* +A shell manager for your ZWave network : PyOzwMan documentation pyozwweb ======== A Flask + socket.io + jquery web application framework for your ZWave -network : *PyOzwWeb documentation* +network : PyOzwWeb documentation api_demo diff --git a/docs/joomla/_sources/INSTALL_ARCH.txt b/INSTALL_ARCH.rst old mode 100644 new mode 100755 similarity index 68% rename from docs/joomla/_sources/INSTALL_ARCH.txt rename to INSTALL_ARCH.rst index 5952128a..6a5ff8aa --- a/docs/joomla/_sources/INSTALL_ARCH.txt +++ b/INSTALL_ARCH.rst @@ -4,9 +4,11 @@ Installing python-openzwave from archive ======================================== -This is the simplest (and the fastest) way to install python-openzwave. It cames with openzwave source files and is already cythonized. +This method is deprecated for 0.4.X. Use pip with --embed flavor. Look at README. -This is surely the best soltion to install python-openzwave on a raspberry pi. +This is the simplest (and the fastest) way to install python-openzwave. It comes with openzwave source files and is already cythonized. + +This is surely the best solution to install python-openzwave on a raspberry pi. Get archive of python-openzwave =============================== @@ -15,7 +17,7 @@ You are now ready to download sources of python-openzwave here : .. code-block:: bash - http://bibi21000.no-ip.biz/python-openzwave/ + https://github.com/OpenZWave/python-openzwave/tree/master/archives This archive contains sources of python-openzwave and openzwave. @@ -50,28 +52,27 @@ Now, you can compile sources : make build -If you have already built python-openzwave or the build failed -you can use the clean option : +If you have already built python-openzwave or if the build failed +you can use the clean target and build again : .. code-block:: bash sudo make clean make build -Do not use root to build python-openzwave as it will surely fails. Please use a "normal user". +Do not use root to build python-openzwave as root it will surely fails. Please use a "normal user". Installation ============ -You can now install the packages using the following command will. +You can now install the packages using the following command : .. code-block:: bash sudo make install -The installation script create a list of installed files. So you can remove -python-openzwave using the following command : +You can remove python-openzwave using : .. code-block:: bash diff --git a/INSTALL_ARCH.txt b/INSTALL_ARCH.txt deleted file mode 100755 index 983d3bac..00000000 --- a/INSTALL_ARCH.txt +++ /dev/null @@ -1,76 +0,0 @@ - -Installing python-openzwave from archive -**************************************** - -This is the simplest (and the fastest) way to install python- -openzwave. It cames with openzwave source files and is already -cythonized. - -This is surely the best soltion to install python-openzwave on a -raspberry pi. - - -Get archive of python-openzwave -=============================== - -You are now ready to download sources of python-openzwave here : - - http://bibi21000.no-ip.biz/python-openzwave/ - -This archive contains sources of python-openzwave and openzwave. - - tar xvzf python-openzwave-X.Y.Z.tar.gz - -This command will extract all the needed sources. And change to the -right directory. - - cd python-openzwave-X.Y.Z - - -Install the needed tools -======================== - -You must install git and other tools to get sources of python- -openzwave and openzwave and build them. Look at the documentation of -your Linux distribution to do that. - -On a debian like distribution : - - sudo make deps - - -Build process -============= - -Now, you can compile sources : - - make build - -If you have already built python-openzwave or the build failed you can -use the clean option : - - sudo make clean - make build - -Do not use root to build python-openzwave as it will surely fails. -Please use a "normal user". - - -Installation -============ - -You can now install the packages using the following command will. - - sudo make install - -The installation script create a list of installed files. So you can -remove python-openzwave using the following command : - - sudo make uninstall - - -If it fails -=========== - -Simply remove the python-openzwave-x.y.z directory and extract it -again. diff --git a/docs/html/_sources/INSTALL_MAC.txt b/INSTALL_MAC.rst old mode 100644 new mode 100755 similarity index 75% rename from docs/html/_sources/INSTALL_MAC.txt rename to INSTALL_MAC.rst index 9ded5e53..6369ee7f --- a/docs/html/_sources/INSTALL_MAC.txt +++ b/INSTALL_MAC.rst @@ -4,6 +4,4 @@ Installing python-openzwave on MacOs ==================================== -To be done - -Looking for volunteers +Look at README for 0.4.X installation. diff --git a/INSTALL_MAC.txt b/INSTALL_MAC.txt deleted file mode 100644 index 75c5011f..00000000 --- a/INSTALL_MAC.txt +++ /dev/null @@ -1,7 +0,0 @@ - -Installing python-openzwave on MacOs -************************************ - -To be done - -Looking for volunteers diff --git a/docs/joomla/_sources/INSTALL_REPO.txt b/INSTALL_REPO.rst old mode 100644 new mode 100755 similarity index 97% rename from docs/joomla/_sources/INSTALL_REPO.txt rename to INSTALL_REPO.rst index 00a6e611..14145af0 --- a/docs/joomla/_sources/INSTALL_REPO.txt +++ b/INSTALL_REPO.rst @@ -4,6 +4,8 @@ Installing python-openzwave from repository =========================================== +This method is deprecated for 0.4.X. Use pip with --git flavor. Look at README. + Install the needed tools ======================== @@ -30,6 +32,12 @@ computer in a directory called python-openzwave. Install dependencies ==================== +Go to the previously created directory + +.. code-block:: bash + + cd python-openzwave + You need some tools (a c++ compiler, headers dir python, ...) to build python-openzwave and openzwave library. On a debian like distribution : @@ -43,11 +51,6 @@ For non-debian (fedora, ...), you can retrieve the packages needed in the Makefi Update and build process ======================== -Go to the previously created directory - -.. code-block:: bash - - cd python-openzwave The following command will update your local repository to the last release of python-openzwave and openzwave. diff --git a/INSTALL_REPO.txt b/INSTALL_REPO.txt deleted file mode 100755 index 5ba93b0e..00000000 --- a/INSTALL_REPO.txt +++ /dev/null @@ -1,109 +0,0 @@ - -Installing python-openzwave from repository -******************************************* - - -Install the needed tools -======================== - -You must install git and make to retrieve sources of python-openzwave -and openzwave. - -On a debian like distribution : - - sudo apt-get install -y git make - - -Get sources of python-openzwave -=============================== - -You are now ready to download sources of python-openzwave : - - git clone https://github.com/OpenZWave/python-openzwave - -The previous command will create a copy of the official repository on -your computer in a directory called python-openzwave. - - -Install dependencies -==================== - -You need some tools (a c++ compiler, headers dir python, ...) to build -python-openzwave and openzwave library. - -On a debian like distribution : - - sudo make repo-deps - -For non-debian (fedora, ...), you can retrieve the packages needed in -the Makefile. - - -Update and build process -======================== - -Go to the previously created directory - - cd python-openzwave - -The following command will update your local repository to the last -release of python-openzwave and openzwave. - - make update - -When update process is done, you can compile sources - - make build - -Or if you have already build python-openzwave in a previous -installation, you can use the clean target to remove old builds. - - sudo make clean - -Do not use root to build python-openzwave as it will surely fails. -Please use a "normal user". - - -Installation -============ - -You can now ready to install the eggs using the following command : - - sudo make install - -You can also remove python-openzwave using : - - sudo make uninstall - - -Running tests -============= - -You can launch the regression tests using : - - make tests - -Keep in mind that the tests will "play" with your nodes : switching on -and off, dimming, adding and removing scenes, ... - - -About the repositroy -==================== - -This repository is a development tool, so it might be "unstable" ... -yeah, sometimes it won't build anymore :) - -If you want to retrieve the last "good" commit, look at -https://github.com/OpenZWave/python-openzwave/commits/master. The -commits names "Auto-commit for docs" are done after the full process : -build + test + docs, so they might be "working" (almost for me). - -You can also build a released version of python-openzwave using tags : - - git tag - - v0.3.0-alpha2 - v0.3.0-alpha3 - v0.3.0-beta1 - v0.3.0-beta2 - v0.3.0a1 diff --git a/INSTALL_WIN.rst b/INSTALL_WIN.rst new file mode 100755 index 00000000..6ced83fc --- /dev/null +++ b/INSTALL_WIN.rst @@ -0,0 +1,187 @@ +:orphan: + +====================================== +Installing python-openzwave on Windows +====================================== + + +Install Microsoft tools +======================= + +This package use MSBuild.exe to build openzwave code. + +You can find it in Visual Studio 2017 or Visual Studio 2015. + +It's also possible to get it as a separate package. + +Only release 14.0 and 15.0 of Microsft Build Tools are tested. + +You nust use the C++ compiler used to build your version of python : https://wiki.python.org/moin/WindowsCompilers + + +Install other tools +=================== + +You need git to clone the repository and python (32 bits or 64 bits). Add it to your PATH. + +Install dependencies : + + - for python 2.7 : + + .. code-block:: bash + + (venvX) pip install Cython six Louie + + - for python 3 : + + .. code-block:: bash + + (venvX) pip install Cython six PyDispatcher + +clone repositories +================== + +Clone python-openzwave: + + +.. code-block:: bash + + git clone https://github.com/OpenZWave/python-openzwave.git + +And clone open-zwave inside python-openzwave : + +.. code-block:: bash + + cd python-openzwave + git clone https://github.com/OpenZWave/open-zwave.git openzwave + +It's mandatory to clone the previous repository in a directory called openzwave (not open-zwave) + +Visual studio +============= + +Copy vs2010 in a new directory vs2017 (or vs2015 depending of which Visual Studio you use) : + +.. code-block:: bash + + xcopy openzwave\cpp\build\windows\vs2010 openzwave\cpp\build\windows\vs2017 /s /e /h + +Open the project (openzwave\cpp\build\windows\vs2017\OpenZWave.sln) in your Visual Studio. +If you want to build for 64bits, add a new target for it. And finally close it. + +Python-openzwave +================ + +Build and install python-openzwave : + + .. code-block:: bash + + python setup.py install --flavor=dev + + .. code-block:: bash + + sysargv ['setup.py', 'install'] + thon setup.py install --flavor=dev + Requirement already satisfied: Cython in c:\program files (x86)\python36-32\lib\site-packages + {'name': 'libopenzwave', 'sources': ['src-lib/libopenzwave/libopenzwave.pyx'], 'include_dirs': ['openzwave/cpp/src', 'openzwave + /cpp/src/value_classes', 'openzwave/cpp/src/platform', 'openzwave/cpp/build/windows', 'src-lib/libopenzwave', 'openzwave/cpp/bu + ild/windows/vs2017/Release/'], 'define_macros': [('PY_LIB_VERSION', '0.4.4'), ('PY_SSIZE_T_CLEAN', 1), ('PY_LIB_FLAVOR', 'dev') + , ('PY_LIB_BACKEND', 'cython')], 'libraries': ['setupapi', 'msvcrt', 'ws2_32', 'dnsapi'], 'extra_objects': ['openzwave/cpp/buil + d/windows/vs2017/Release//OpenZWave.lib'], 'extra_compile_args': [], 'extra_link_args': [], 'language': 'c++'} + ['six', 'PyDispatcher>=2.0.5', 'Cython'] + Requirement already satisfied: Cython in c:\program files (x86)\python36-32\lib\site-packages + running install + flavor --flavor=dev c:\program files (x86)\python36-32\lib\site-packages + running build_openzwave + Found MSBuild.exe : c:/Program Files (x86)/Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe + Found arch : Win32 wave + Found Visual Studio project : vs2017 (x86)/Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe + Found build path : openzwave/cpp/build/windows/vs2017/Release/ + ... + ... + byte-compiling C:\Program Files (x86)\Python36-32\Lib\site-packages\python_openzwave\scripts\__init__.py to __init__.cpython-36 + .pyc + running install_egg_info + running egg_info + writing python_openzwave.egg-info\PKG-INFO + writing dependency_links to python_openzwave.egg-info\dependency_links.txt + writing entry points to python_openzwave.egg-info\entry_points.txt + ================================================================ + .\scripts\allusers.bat + this script is executed for all users + delete/rename it if you dont need it + ================================================================ + Page de codes active�: 437 + +And finally, test it : + + .. code-block:: bash + + pyozw_check -l -d COM2 -t 30 + + .. code-block:: bash + + ------------------------------------------------------------------------------- + Define options for device COM2 + Start network + Wait for network awake (30s) + ------------------------------------------------------------------------------- + Network is awaked. Talk to controller. + Get python_openzwave version : 0.4.4 + Get python_openzwave config version : Original Z-Wave 2.78 + Get python_openzwave flavor : dev + Get openzwave version : 1.4.2942 + Get config path : C:\Program Files\Python36\lib\site-packages\python_openzwave\ozw_config + Controller capabilities : {'primaryController', 'staticUpdateController'} + Controller node capabilities : {'listening', 'primaryController', 'beaming', 'staticUpdateController'} + Nodes in network : 4 + ------------------------------------------------------------------------------- + Wait for network ready (30s) + ------------------------------------------------------------------------------- + Network is ready. Get nodes + ------------------------------------------------------------ + 1 - Name : ( Location : ) + 1 - Ready : True / Awake : True / Failed : False + 1 - Manufacturer : Aeotec ( id : 0x0086 ) + 1 - Product : DSA02203 Z-Stick S2 ( id : 0x0001 / type : 0x0002 / Version : 3) + 1 - Command classes : set() + 1 - Capabilities : {'listening', 'primaryController', 'beaming', 'staticUpdateController'} + 1 - Neighbors : {4} / Power level : None + 1 - Is sleeping : False / Can wake-up : False / Battery level : None + ------------------------------------------------------------ + 2 - Name : ( Location : ) + 2 - Ready : True / Awake : True / Failed : False + 2 - Manufacturer : ( id : 0x0000 ) + 2 - Product : ( id : 0x0000 / type : 0x0000 / Version : 2) + 2 - Command classes : set() + 2 - Capabilities : {'listening', 'routing'} + 2 - Neighbors : {3} / Power level : None + 2 - Is sleeping : False / Can wake-up : False / Battery level : None + ------------------------------------------------------------ + 3 - Name : ( Location : ) + 3 - Ready : False / Awake : True / Failed : True + 3 - Manufacturer : ( id : 0x0000 ) + 3 - Product : ( id : 0x0000 / type : 0x0000 / Version : 3) + 3 - Command classes : set() + 3 - Capabilities : {'listening', 'routing', 'beaming'} + 3 - Neighbors : set() / Power level : None + 3 - Is sleeping : False / Can wake-up : False / Battery level : None + ------------------------------------------------------------ + 4 - Name : ( Location : ) + 4 - Ready : True / Awake : True / Failed : False + 4 - Manufacturer : GreenWave ( id : 0x0099 ) + 4 - Product : PowerNode 6 port ( id : 0x0004 / type : 0x0003 / Version : 4) + 4 - Command classes : {'COMMAND_CLASS_MANUFACTURER_SPECIFIC', 'COMMAND_CLASS_ASSOCIATION', 'COMMAND_CLASS_NO_OPERATION', 'COMM + AND_CLASS_VERSION', 'COMMAND_CLASS_SWITCH_BINARY', 'COMMAND_CLASS_MULTI_INSTANCE/CHANNEL', 'COMMAND_CLASS_CRC_16_ENCAP', 'COMMA + ND_CLASS_PROTECTION', 'COMMAND_CLASS_CONFIGURATION', 'COMMAND_CLASS_BASIC', 'COMMAND_CLASS_METER', 'COMMAND_CLASS_SWITCH_ALL'} + 4 - Capabilities : {'listening', 'routing', 'beaming'} + 4 - Neighbors : {1} / Power level : None + 4 - Is sleeping : False / Can wake-up : False / Battery level : None + ------------------------------------------------------------ + Driver statistics : {'SOFCnt': 49, 'ACKWaiting': 0, 'readAborts': 0, 'badChecksum': 0, 'readCnt': 49, 'writeCnt': 46, 'CANCnt': + 0, 'NAKCnt': 1, 'ACKCnt': 30, 'OOFCnt': 0, 'dropped': 17, 'retries': 0, 'callbacks': 0, 'badroutes': 0, 'noack': 4, 'netbusy': + 0, 'nondelivery': 0, 'routedbusy': 0, 'broadcastReadCnt': 0, 'broadcastWriteCnt': 9} + ------------------------------------------------------------ + Stop network + Exit + diff --git a/INSTALL_WIN.txt b/INSTALL_WIN.txt deleted file mode 100644 index c59d442e..00000000 --- a/INSTALL_WIN.txt +++ /dev/null @@ -1,7 +0,0 @@ - -Installing python-openzwave on Windows -************************************** - -To be done - -Looking for volunteers diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 00000000..83ea5ef6 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,22 @@ +This file is part of python-openzwave project +https://github.com/OpenZWave/python-openzwave. + + +License +******* + +python-openzwave is free software: you can redistribute it and/or +modify it under the terms of the GNU General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +python-openzwave is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with python-openzwave. If not, see http://www.gnu.org/licenses. + +author: bibi21000 author: maarten damen license: +GPL(v3) diff --git a/Makefile b/Makefile index b4bfd0dc..9bb1a49b 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,9 @@ # You can set these variables from the command line. ARCHBASE = archive +ARCHIVES = archives BUILDDIR = build DISTDIR = dists -NOSE = $(shell which nosetests) NOSEOPTS = --verbosity=2 NOSECOVER = --cover-package=openzwave,pyozwman,pyozwweb --with-coverage --cover-inclusive --cover-tests --cover-html --cover-html-dir=docs/html/coverage --with-html --html-file=docs/html/nosetests/nosetests.html PYLINT = $(shell which pylint) @@ -17,6 +17,10 @@ ifndef PYTHON_EXEC PYTHON_EXEC=python endif +ifndef NOSE_EXEC +NOSE_EXEC=$(shell which nosetests) +endif + ifdef VIRTUAL_ENV python_version_full := $(wordlist 2,4,$(subst ., ,$(shell ${VIRTUAL_ENV}/bin/${PYTHON_EXEC} --version 2>&1))) else @@ -34,21 +38,24 @@ ifeq (${python_version_major},3) PIP_EXEC=pip3 endif +WHL_PYTHON2 := $(shell ls dist/*.whl 2>/dev/null|grep ${python_openzwave_version}|grep [0-9]-cp2) +WHL_PYTHON3 := $(shell ls dist/*.whl 2>/dev/null|grep ${python_openzwave_version}|grep [0-9]-cp3) + ARCHNAME = python-openzwave-${python_openzwave_version} ARCHDIR = ${ARCHBASE}/${ARCHNAME} -.PHONY: help clean all update build develop install install-api uninstall clean-docs docs autobuild-tests tests pylint commit developper-deps python-deps autobuild-deps arch-deps common-deps cython-deps merge-python3 check +.PHONY: help clean all update develop install install-api uninstall clean-docs docs autobuild-tests tests pylint commit developer-deps python-deps autobuild-deps arch-deps common-deps cython-deps check venv-clean venv2 venv3 help: @echo "Please use \`make ' where is one of" @echo " build : build python-openzwave and openzwave" - @echo " develop : install python-openzwave for developpers" + @echo " develop : install python-openzwave for developers" @echo " install : install python-openzwave for users" @echo " install-api : install python-openzwave (API only) for users" @echo " uninstall : uninstall python-openzwave" - @echo " developper-deps : install dependencies for developpers" + @echo " developer-deps : install dependencies for developers" @echo " deps : install dependencies for users" - @echo " docs : make documentation" + @echo " docs : make documentation" @echo " tests : launch tests" @echo " commit : publish python-openzwave updates on GitHub" @echo " clean : clean the development directory" @@ -57,12 +64,14 @@ help: clean: clean-docs clean-archive -rm -rf $(BUILDDIR) -find . -name \*.pyc -delete - -cd openzwave && make clean + -cd openzwave && $(MAKE) clean ${PYTHON_EXEC} setup-lib.py clean --all --build-base $(BUILDDIR)/lib ${PYTHON_EXEC} setup-api.py clean --all --build-base $(BUILDDIR)/api ${PYTHON_EXEC} setup-manager.py clean --all --build-base $(BUILDDIR)/manager ${PYTHON_EXEC} setup-web.py clean --all --build-base $(BUILDDIR)/web - -rm lib/libopenzwave.cpp + ${PYTHON_EXEC} setup.py clean --all --build-base $(BUILDDIR)/python_openzwave + -rm -f lib/libopenzwave.cpp + -rm -f libopenzwave.so -rm src-lib/libopenzwave/libopenzwave.cpp -rm -rf debian/python-openzwave-api/ -rm -rf debian/python-openzwave-doc/ @@ -73,6 +82,13 @@ clean: clean-docs clean-archive -rm debian/*.debhelper -rm debian/*.debhelper.log -rm debian/*.substvars + -rm -rf .tests_user_path/ + -rm -rf openzwave-git + -rm -rf openzwave-embed + -rm -rf open-zwave-master + -rm -rf dist + -rm -rf tmp + -rm -rf venv2 venv3 uninstall: -rm -rf $(BUILDDIR) @@ -83,17 +99,20 @@ uninstall: -yes | ${PIP_EXEC} uninstall openzwave -yes | ${PIP_EXEC} uninstall pyozwman -yes | ${PIP_EXEC} uninstall pyozwweb - ${PYTHON_EXEC} setup-lib.py develop --uninstall + -yes | ${PIP_EXEC} uninstall python_openzwave + ${PYTHON_EXEC} setup-lib.py develop --uninstall --flavor=dev ${PYTHON_EXEC} setup-api.py develop --uninstall ${PYTHON_EXEC} setup-manager.py develop --uninstall ${PYTHON_EXEC} setup-web.py develop --uninstall + ${PYTHON_EXEC} setup.py develop --uninstall --flavor=dev -rm -f libopenzwave.so - -rm -f src-lib/libopenzwave.so + -rm -f src-lib/libopenzwave*.so -rm -f libopenzwave/liopenzwave.so -rm -Rf python_openzwave_api.egg-info/ -rm -Rf src-api/python_openzwave_api.egg-info/ -rm -Rf src-api/openzwave.egg-info/ -rm -Rf src-manager/pyozwman.egg-info/ + -rm -Rf python_openzwave.egg-info/ -rm -Rf src-lib/python_openzwave_lib.egg-info/ -rm -Rf src-lib/libopenzwave.egg-info/ -rm -Rf src-web/pyozwweb.egg-info/ @@ -106,21 +125,16 @@ uninstall: -rm -Rf /usr/local/share/python-openzwave -rm -Rf /usr/local/share/openzwave -check: .git - -.git: - @echo "Invalid git repository" && exit 1 - -developper-deps: common-deps cython-deps tests-deps pip-deps doc-deps +developer-deps: common-deps cython-deps tests-deps pip-deps doc-deps @echo - @echo "Dependencies for developpers of python-openzwave installed (python ${python_version_full})" + @echo "Dependencies for developers of python-openzwave installed (python ${python_version_full})" repo-deps: common-deps cython-deps tests-deps pip-deps @echo @echo "Dependencies for users installed (python ${python_version_full})" autobuild-deps: common-deps cython-deps tests-deps pip-deps - apt-get install -y git + apt-get install --force-yes -y git @echo @echo "Dependencies for autobuilders (docker, travis, ...) installed (python ${python_version_full})" @@ -130,29 +144,34 @@ arch-deps: common-deps pip-deps python-deps: ifeq (${python_version_major},2) - apt-get install -y python2.7 python2.7-dev python2.7-minimal + apt-get install --force-yes -y python2.7 python2.7-dev python2.7-minimal libyaml-dev python-pip endif ifeq (${python_version_major},3) - -apt-get install -y python3 python3-dev python3-minimal + apt-get install --force-yes -y python3 python3-dev python3-minimal libyaml-dev python3-pip endif cython-deps: ifeq (${python_version_major},2) - apt-get install -y cython + apt-get install --force-yes -y cython endif ifeq (${python_version_major},3) - -apt-get install -y cython3 + apt-get install --force-yes -y cython3 endif +ci-deps: + apt-get install --force-yes -y python-pip python-dev python-docutils python-setuptools python-virtualenv + -apt-get install --force-yes -y python3-pip python3-docutils python3-dev python3-setuptools + apt-get install --force-yes -y build-essential libudev-dev g++ libyaml-dev + common-deps: @echo Installing dependencies for python : ${python_version_full} ifeq (${python_version_major},2) - apt-get install -y python-pip python-dev python-docutils python-setuptools python-louie + apt-get install --force-yes -y python-pip python-dev python-docutils python-setuptools endif ifeq (${python_version_major},3) - -apt-get install -y python3-pip python3-docutils python3-dev python3-setuptools + -apt-get install --force-yes -y python3-pip python3-docutils python3-dev python3-setuptools endif - apt-get install -y build-essential libudev-dev g++ + apt-get install --force-yes -y build-essential libudev-dev g++ libyaml-dev tests-deps: ${PIP_EXEC} install nose-html @@ -162,8 +181,8 @@ tests-deps: ${PIP_EXEC} install pylint doc-deps: - -apt-get install -y python-sphinx - ${PIP_EXEC} install sphinxcontrib-blockdiag sphinxcontrib-actdiag sphinxcontrib-nwdiag sphinxcontrib-seqdiag + -apt-get install --force-yes -y python-sphinx + ${PIP_EXEC} install cython sphinxcontrib-blockdiag sphinxcontrib-actdiag sphinxcontrib-nwdiag sphinxcontrib-seqdiag pip-deps: #${PIP_EXEC} install docutils @@ -171,78 +190,80 @@ pip-deps: #The following line crashes with a core dump #${PIP_EXEC} install "Cython==0.22" -merge-python3: - git checkout python3 - git merge -m "Auto-merge from master" master - git push - git checkout master - @echo - @echo "Commits for branch python3 pushed on github." - clean-docs: - cd docs && make clean + cd docs && $(MAKE) clean -rm -Rf docs/html -rm -Rf docs/joomla -rm -Rf docs/pdf docs: clean-docs - -mkdir -p docs/html/nosetests - -mkdir -p docs/html/coverage - -mkdir -p docs/html/pylint - -mkdir -p docs/joomla/nosetests - -mkdir -p docs/joomla/coverage - -mkdir -p docs/joomla/pylint - $(NOSE) $(NOSEOPTS) $(NOSECOVER) tests/ - #$(NOSE) $(NOSEOPTS) tests/ - -cp docs/html/nosetests/* docs/joomla/nosetests - -cp docs/html/coverage/* docs/joomla/coverage - -$(PYLINT) --output-format=html $(PYLINTOPTS) src-lib/libopenzwave/ src-api/openzwave/ src-manager/pyozwman/ src-web/pyozwweb/>docs/html/pylint/report.html - -cp docs/html/pylint/* docs/joomla/pylint/ - cd docs && make docs + #-mkdir -p docs/html/nosetests + #-mkdir -p docs/html/coverage + #-mkdir -p docs/html/pylint + #-mkdir -p docs/joomla/nosetests + #-mkdir -p docs/joomla/coverage + #-mkdir -p docs/joomla/pylint + #${NOSE_EXEC} $(NOSEOPTS) $(NOSECOVER) tests/ + #${NOSE_EXEC} $(NOSEOPTS) tests/ + #-cp docs/html/nosetests/* docs/joomla/nosetests + #-cp docs/html/coverage/* docs/joomla/coverage + #-$(PYLINT) --output-format=html $(PYLINTOPTS) src-lib/libopenzwave/ src-api/openzwave/ src-manager/pyozwman/ src-web/pyozwweb/>docs/html/pylint/report.html + #-cp docs/html/pylint/* docs/joomla/pylint/ + cd docs && $(MAKE) docs cp docs/README.rst README.rst - cp docs/_build/text/INSTALL_REPO.txt . - cp docs/_build/text/INSTALL_ARCH.txt . - cp docs/_build/text/INSTALL_MAC.txt . - cp docs/_build/text/INSTALL_WIN.txt . + cp docs/INSTALL_REPO.rst . + cp docs/INSTALL_ARCH.rst . + cp docs/INSTALL_MAC.rst . + cp docs/INSTALL_WIN.rst . cp docs/_build/text/COPYRIGHT.txt . + cp docs/_build/text/COPYRIGHT.txt LICENSE.txt cp docs/_build/text/CHANGELOG.txt . cp docs/_build/text/DEVEL.txt . cp docs/_build/text/EXAMPLES.txt . - cp -Rf docs/_build/html/* docs/html/ - cp -Rf docs/_build/joomla/* docs/joomla/ + #cp -Rf docs/_build/html/* docs/html/ + #cp -Rf docs/_build/joomla/* docs/joomla/ @echo @echo "Documentation finished." -install-api: build - ${PYTHON_EXEC} setup-lib.py install +install-lib: + ${PYTHON_EXEC} setup-lib.py install --flavor=git + @echo + @echo "Installation of lib finished." + +install-api: install-lib ${PYTHON_EXEC} setup-api.py install @echo @echo "Installation of API finished." -install: install-api +install-manager: install-api ${PYTHON_EXEC} setup-manager.py install + @echo + @echo "Installation of manager finished." + +install: install-manager ${PYTHON_EXEC} setup-web.py install @echo @echo "Installation for users finished." -develop: build - ${PYTHON_EXEC} setup-lib.py develop +develop: src-lib/libopenzwave/libopenzwave.cpp + ${PYTHON_EXEC} setup-lib.py develop --flavor=dev ${PYTHON_EXEC} setup-api.py develop ${PYTHON_EXEC} setup-manager.py develop ${PYTHON_EXEC} setup-web.py develop + ${PYTHON_EXEC} setup.py develop --flavor=dev @echo - @echo "Installation for developpers of python-openzwave finished." + @echo "Installation for developers of python-openzwave finished." tests: - #export NOSESKIP=False && $(NOSE) $(NOSEOPTS) tests/ --with-progressive; unset NOSESKIP - export NOSESKIP=False && $(NOSE) $(NOSEOPTS) tests ; unset NOSESKIP + export NOSESKIP=False && ${NOSE_EXEC} $(NOSEOPTS) tests/; unset NOSESKIP +#~ export NOSESKIP=False && ${NOSE_EXEC} $(NOSEOPTS) tests/lib tests/api tests/manager ; unset NOSESKIP @echo - @echo "Autobuild-tests for ZWave network finished." + @echo "Tests for ZWave network finished." autobuild-tests: - $(NOSE) $(NOSEOPTS) tests/lib/autobuild tests/api/autobuild tests/manager/autobuild tests/web/autobuild + ${NOSE_EXEC} $(NOSEOPTS) tests/lib/autobuild tests/api/autobuild @echo - @echo "Tests for ZWave network finished." + @echo "Autobuild-tests for ZWave network finished." pylint: $(PYLINT) $(PYLINTOPTS) src-lib/libopenzwave/ src-api/openzwave/ src-manager/pyozwman/ src-web/pyozwweb/ @@ -253,20 +274,23 @@ update: openzwave git pull cd openzwave && git pull -build: build-openzwave - ${PYTHON_EXEC} setup-lib.py build --build-base $(BUILDDIR)/lib - ${PYTHON_EXEC} setup-api.py build --build-base $(BUILDDIR)/api - ${PYTHON_EXEC} setup-manager.py build --build-base $(BUILDDIR)/manager - ${PYTHON_EXEC} setup-web.py build --build-base $(BUILDDIR)/web +build: openzwave/.lib/ + ${PYTHON_EXEC} setup-lib.py build --flavor=dev -build-openzwave: openzwave/libopenzwave.a +src-lib/libopenzwave/libopenzwave.cpp: openzwave/.lib/ + ${PYTHON_EXEC} setup-lib.py build --flavor=dev openzwave: git clone git://github.com/OpenZWave/open-zwave.git openzwave -openzwave/libopenzwave.a: openzwave - sed -i '253s/.*//' openzwave/cpp/src/value_classes/ValueID.h - cd openzwave && make +openzwave.gzip: + wget --no-check-certificate https://codeload.github.com/OpenZWave/open-zwave/zip/master + mv master open-zwave-master.zip + unzip open-zwave-master.zip + mv open-zwave-master openzwave + +openzwave/.lib/: openzwave + cd openzwave && $(MAKE) -j 4 clean-archive: -rm -rf $(ARCHBASE) @@ -294,7 +318,7 @@ $(ARCHDIR): -find $(ARCHDIR) -name zwscene.xml -delete -find $(ARCHDIR) -name zwbutton.xml -delete -find $(ARCHDIR) -name pyozw.db -delete - -cd $(ARCHDIR)/openzwave && make clean + -cd $(ARCHDIR)/openzwave && $(MAKE) clean -rm -Rf $(ARCHDIR)/openzwave/.git cp -f $(ARCHDIR)/openzwave.vers.cpp $(ARCHDIR)/openzwave/cpp/src/vers.cpp @@ -318,36 +342,993 @@ tgz: clean-archive $(ARCHDIR) docs -mkdir -p $(DISTDIR) tar cvzf $(DISTDIR)/python-openzwave-${python_openzwave_version}.tgz -C $(ARCHBASE) ${ARCHNAME} rm -Rf $(ARCHBASE) + mv $(DISTDIR)/python-openzwave-${python_openzwave_version}.tgz $(ARCHIVES)/ @echo @echo "Archive for version ${python_openzwave_version} created" -push: build develop docs - git commit -m "Auto-commit for docs" README.rst INSTALL_REPO.txt INSTALL_MAC.txt INSTALL_WIN.txt INSTALL_ARCH.txt COPYRIGHT.txt DEVEL.txt EXAMPLES.txt CHANGELOG.txt docs/ - git push +embed_openzave_master:clean-archive src-lib/libopenzwave/libopenzwave.cpp + -rm -Rf $(ARCHBASE)/open-zwave-master + -mkdir -p $(ARCHBASE)/open-zwave-master/python-openzwave/src-lib/libopenzwave + cp -Rf openzwave/* $(ARCHBASE)/open-zwave-master/ + cp -f openzwave/cpp/src/vers.cpp $(ARCHBASE)/open-zwave-master/python-openzwave/openzwave.vers.cpp + cp -f src-lib/libopenzwave/libopenzwave.cpp $(ARCHBASE)/open-zwave-master/python-openzwave/src-lib/libopenzwave/ + -find $(ARCHBASE)/open-zwave-master -name \*.pyc -delete 2>/dev/null || true + -find $(ARCHBASE)/open-zwave-master -name zwcfg_\*.xml -delete 2>/dev/null || true + -find $(ARCHBASE)/open-zwave-master -name OZW_Log.log -delete 2>/dev/null || true + -find $(ARCHBASE)/open-zwave-master -name OZW_Log.txt -delete 2>/dev/null || true + -find $(ARCHBASE)/open-zwave-master -name ozwsh.log -delete 2>/dev/null || true + -find $(ARCHBASE)/open-zwave-master -name errors.log -delete 2>/dev/null || true + -find $(ARCHBASE)/open-zwave-master -name zwscene.xml -delete 2>/dev/null || true + -find $(ARCHBASE)/open-zwave-master -name zwbutton.xml -delete 2>/dev/null || true + -find $(ARCHBASE)/open-zwave-master -name pyozw.db -delete 2>/dev/null || true + -cd $(ARCHBASE)/open-zwave-master && $(MAKE) clean + -rm -Rf $(ARCHBASE)/open-zwave-master/.git + -rm -f $(ARCHBASE)/open-zwave-master/open-zwave-master.zip + -rm -Rf $(ARCHBASE)/open-zwave-master/docs/* + -cp -f openzwave/docs/default.htm $(ARCHBASE)/open-zwave-master/docs/* + -rm -Rf $(ARCHBASE)/open-zwave-master/dotnet/* + cp -f $(ARCHBASE)/open-zwave-master/python-openzwave/openzwave.vers.cpp $(ARCHBASE)/open-zwave-master/cpp/src/vers.cpp + -mkdir -p $(DISTDIR) + cd $(ARCHBASE) && zip -r ../$(DISTDIR)/open-zwave-master-${python_openzwave_version}.zip open-zwave-master + mv $(DISTDIR)/open-zwave-master-${python_openzwave_version}.zip $(ARCHIVES)/ + @echo + @echo "embed_openzave_master for version ${python_openzwave_version} created" + +pypi_package:clean-archive + -rm -Rf $(ARCHBASE)/python_openzwave/ + ${PYTHON_EXEC} setup.py egg_info + -mkdir -p $(ARCHBASE)/python_openzwave/ + cp -Rf src-python_openzwave $(ARCHBASE)/python_openzwave/ + cp -Rf src-lib $(ARCHBASE)/python_openzwave/ + cp -Rf src-api $(ARCHBASE)/python_openzwave/ + cp -Rf src-manager $(ARCHBASE)/python_openzwave/ + cp -f setup.cfg $(ARCHBASE)/python_openzwave/ + cp -f setup.py $(ARCHBASE)/python_openzwave/ + cp -f pyozw_pkgconfig.py $(ARCHBASE)/python_openzwave/ + cp -f pyozw_setup.py $(ARCHBASE)/python_openzwave/ + cp -f pyozw_version.py $(ARCHBASE)/python_openzwave/ + cp -f pyozw_win.py $(ARCHBASE)/python_openzwave/ + cp -f pyozw_progressbar.py $(ARCHBASE)/python_openzwave/ + cp -f python_openzwave.egg-info/PKG-INFO $(ARCHBASE)/python_openzwave/ + -find $(ARCHBASE)/python_openzwave/ -name \*.pyc -delete 2>/dev/null || true + -find $(ARCHBASE)/python_openzwave/ -name \*.so -delete 2>/dev/null || true + -find $(ARCHBASE)/python_openzwave/ -type d -name \*.egg-info -exec rm -rf '{}' \; 2>/dev/null || true + -find $(ARCHBASE)/python_openzwave/ -name zwcfg_\*.xml -delete + -find $(ARCHBASE)/python_openzwave/ -name OZW_Log.log -delete + -find $(ARCHBASE)/python_openzwave/ -name OZW_Log.txt -delete + -find $(ARCHBASE)/python_openzwave/ -name ozwsh.log -delete + -find $(ARCHBASE)/python_openzwave/ -name errors.log -delete + -find $(ARCHBASE)/python_openzwave/ -name zwscene.xml -delete + -find $(ARCHBASE)/python_openzwave/ -name zwbutton.xml -delete + -find $(ARCHBASE)/python_openzwave/ -name pyozw.db -delete + -rm -f $(ARCHBASE)/python_openzwave/src-lib/libopenzwave/libopenzwave.cpp + -mkdir -p $(DISTDIR) || src-lib/ + cd $(ARCHBASE) && zip -r ../$(DISTDIR)/python_openzwave-${python_openzwave_version}.zip python_openzwave + mv $(DISTDIR)/python_openzwave-${python_openzwave_version}.zip $(ARCHIVES)/ + @echo + @echo "pypi_package for version ${python_openzwave_version} created" + +push: develop + -git commit -m "Auto-commit for docs" README.rst INSTALL_REPO.rst INSTALL_MAC.rst INSTALL_WIN.rst INSTALL_ARCH.rst COPYRIGHT.txt DEVEL.txt EXAMPLES.txt CHANGELOG.txt docs/ + -git push @echo @echo "Commits for branch master pushed on github." -commit: push merge-python3 +commit: push @echo - @echo "Commits for branches master/python3 pushed on github." + @echo "Commits for branches master pushed on github." -tag: commit - git tag v${python_openzwave_version} +tag: + -git tag v${python_openzwave_version} git push origin v${python_openzwave_version} @echo @echo "Tag pushed on github." -ftp: - @./ftp.sh python-openzwave-${python_openzwave_version}.tgz +validate-pr: uninstall clean update develop + @echo '////////////////////////////////////////////////////////////////////////////////////////////' + @echo '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + @echo '////////////////////////////////////////////////////////////////////////////////////////////' + @echo + @echo + @echo "Tests to validate a PR" + @echo @echo - @echo "New version ${python_openzwave_version} published tp ftp" -new-version: tag tgz debch ftp + $(MAKE) venv-dev-autobuild-tests + $(MAKE) venv-bdist_wheel-whl-autobuild-tests + $(MAKE) venv-bdist_wheel-autobuild-tests +#~ $(MAKE) venv-tests + + @echo + @echo + @echo "Tests to validate a PR finished" + @echo + @echo + @echo '////////////////////////////////////////////////////////////////////////////////////////////' + @echo '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + @echo '////////////////////////////////////////////////////////////////////////////////////////////' + @echo + +new-version: validate-pr + @echo '////////////////////////////////////////////////////////////////////////////////////////////' + @echo '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + @echo '////////////////////////////////////////////////////////////////////////////////////////////' + @echo '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + @echo + @echo + @echo "Make a new version ${python_openzwave_version}" + @echo + @echo + + -$(MAKE) docs + -git commit -m "Auto-commit for new-version" README.rst INSTALL_REPO.rst INSTALL_MAC.rst INSTALL_WIN.rst INSTALL_ARCH.rst LICENSE.txt COPYRIGHT.txt DEVEL.txt EXAMPLES.txt CHANGELOG.txt docs/ + -git checkout $(ARCHIVES)/ + -git commit -m "Update pyozw_version to ${python_openzwave_version}" pyozw_version.py + $(MAKE) debch + -git commit -m "Update debian version to ${python_openzwave_version}" debian/ + -$(MAKE) embed_openzave_master + -$(MAKE) pypi_package + -git add $(ARCHIVES)/python_openzwave-${python_openzwave_version}.zip && git commit -m "Add new pypi package" $(ARCHIVES)/python_openzwave-${python_openzwave_version}.zip && git push + -git add $(ARCHIVES)/open-zwave-master-${python_openzwave_version}.zip && git commit -m "Add new embed package" $(ARCHIVES)/open-zwave-master-${python_openzwave_version}.zip && git push + -git checkout $(ARCHIVES)/* + -twine upload archives/python_openzwave-${python_openzwave_version}.zip -r pypitest + -twine upload archives/python_openzwave-${python_openzwave_version}.zip -r pypi + -$(MAKE) tag + sleep 60 + $(MAKE) venv-pypitest-autobuild-tests + $(MAKE) venv-pypilive-autobuild-tests + + @echo @echo @echo "New version ${python_openzwave_version} created and published" + @echo + @echo + @echo '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + @echo '////////////////////////////////////////////////////////////////////////////////////////////' + @echo '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + @echo '////////////////////////////////////////////////////////////////////////////////////////////' + @echo debch: - dch --newversion ${python_openzwave_version} --maintmaint "Automatic release from upstream" + dch --newversion ${python_openzwave_version} --maintmaint "Automatic release from upstream. Look at CHANGELOG.txt" deb: dpkg-buildpackage + +venv-deps: common-deps + apt-get install --force-yes -y python-all python-dev python3-all python3-dev python-virtualenv python-pip +#~ apt-get install --force-yes -y python-wheel-common python3-wheel python-wheel python-pip-whl + apt-get install --force-yes -y pkg-config wget unzip zip + pip install Cython==0.28.6 + pip install wheel + +docker-deps: common-deps + apt-get install --force-yes -y python-all python-dev python3-all python3-dev python-virtualenv + apt-get install --force-yes -y python3-pip python-pip python-wheel python3-wheel python-pip-whl + apt-get install --force-yes -y wget unzip zip + apt-get install --force-yes -y g++ libudev-dev libyaml-dev + pip install Cython==0.28.6 + pip3 install Cython==0.28.6 + +venv2: + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo "New venv for python2" + @echo + + virtualenv --python=python2 venv2 + venv2/bin/python --version + venv2/bin/pip install nose + venv2/bin/pip install Cython==0.28.6 wheel six pyserial + venv2/bin/pip install 'Louie>=1.1' + chmod 755 venv2/bin/activate + -rm -f src-lib/libopenzwave/libopenzwave.cpp + + @echo + @echo "Venv for python2 created" + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + +venv3: + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo "New venv for python3" + @echo + + virtualenv --python=python3 venv3 + venv3/bin/python --version + venv3/bin/pip install nose + venv3/bin/pip install Cython==0.28.6 wheel six pyserial + venv3/bin/pip install 'PyDispatcher>=2.0.5' + chmod 755 venv3/bin/activate + -rm -f src-lib/libopenzwave/libopenzwave.cpp + + @echo + @echo "Venv for python3 created" + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + +venv2-dev: venv2 src-lib/libopenzwave/libopenzwave.cpp + venv2/bin/python setup-lib.py develop --flavor=dev + venv2/bin/python setup-api.py develop + venv2/bin/python setup-manager.py develop + +venv3-dev: venv3 src-lib/libopenzwave/libopenzwave.cpp + venv3/bin/python setup-lib.py develop --flavor=dev + venv3/bin/python setup-api.py develop + venv3/bin/python setup-manager.py develop + +venv2-install: venv2 src-lib/libopenzwave/libopenzwave.cpp + venv2/bin/python setup.py install --flavor=dev + +venv3-install: venv3 src-lib/libopenzwave/libopenzwave.cpp + venv3/bin/python setup.py install --flavor=dev + +venv2-shared: venv2 src-lib/libopenzwave/libopenzwave.cpp + venv2/bin/python setup-lib.py install --flavor=shared + venv2/bin/python setup-api.py install + venv2/bin/python setup-manager.py install + +venv3-shared: venv3 src-lib/libopenzwave/libopenzwave.cpp + venv3/bin/python setup-lib.py install --flavor=shared + venv3/bin/python setup-api.py install +#~ venv3/bin/python setup-manager.py install + +venv-clean: + @echo "Clean files in venvs" + -rm -rf venv2 + -rm -rf venv3 + -rm -f src-lib/libopenzwave/libopenzwave.cpp + +venv-tests: venv2-tests venv3-tests + +venv2-tests: venv2-dev + @echo ========================================================================================== + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -$(MAKE) PYTHON_EXEC=venv2/bin/python NOSE_EXEC=venv2/bin/nosetests tests + + @echo + @echo + @echo "Tests for venv2 done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv3-tests: venv3-dev + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -$(MAKE) PYTHON_EXEC=venv3/bin/python NOSE_EXEC=venv3/bin/nosetests tests + + @echo + @echo + @echo "Tests for venv3 done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-autobuild-tests: clean + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-autobuild-autobuild-tests." + @echo + @echo + + $(MAKE) venv-pypitest-autobuild-tests + $(MAKE) venv-pypilive-autobuild-tests + $(MAKE) venv-embed-autobuild-tests + $(MAKE) venv-bdist_wheel-whl-autobuild-tests + $(MAKE) venv-bdist_wheel-autobuild-tests + $(MAKE) venv-pypi-autobuild-tests + $(MAKE) venv-dev-autobuild-tests + $(MAKE) venv-git-autobuild-tests + + @echo + @echo + @echo "Tests for venv-autobuild-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-continuous-autobuild-tests: + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-continuous-autobuild-tests." + @echo + @echo + + -$(MAKE) venv-embed-autobuild-tests + -$(MAKE) venv-embed_shared-autobuild-tests + -$(MAKE) venv-git-autobuild-tests + -$(MAKE) venv-git_shared-autobuild-tests + -$(MAKE) venv-bdist_wheel-whl-autobuild-tests + -$(MAKE) venv-bdist_wheel-autobuild-tests + -$(MAKE) venv-pypi-autobuild-tests + + @echo + @echo + @echo "Tests for venv-continuous-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-git-autobuild-tests: venv-clean venv2 venv3 + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-git-autobuild-tests." + @echo + @echo + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + venv2/bin/python setup-lib.py install --flavor=git + venv2/bin/python setup-api.py install + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild + venv2/bin/python venv2/bin/pyozw_check + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(git-' + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + venv3/bin/python setup-lib.py install --flavor=git + venv3/bin/python setup-api.py install + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild + venv3/bin/python venv3/bin/pyozw_check + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(git-' + + @echo + @echo + @echo "Tests for venv-git-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-pypitest-autobuild-tests: venv-clean venv2 venv3 + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-pypitest-autobuild-tests." + @echo + @echo + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -f libopenzwave*.so + venv2/bin/pip install "urwid>=1.1.1" + venv2/bin/pip install -i https://pypi.python.org/pypi -vvv python_openzwave + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(embed-' + venv2/bin/pip install "Cython" + venv2/bin/pip uninstall python_openzwave -y + venv2/bin/pip install -i https://pypi.python.org/pypi -vvv python_openzwave --install-option="--flavor=git" + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv2/bin/pip install -i https://pypi.python.org/pypi -vvv python_openzwave --force --install-option="--flavor=git" + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv2/bin/python venv2/bin/pyozw_check + venv2/bin/python venv2/bin/pyozw_shell --help + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(git-' + venv2/bin/pip uninstall python_openzwave -y + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -f libopenzwave*.so + venv3/bin/pip install "urwid>=1.1.1" + venv3/bin/pip install -i https://pypi.python.org/pypi -vvv python_openzwave + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(embed-' + venv3/bin/pip install "Cython" + venv3/bin/pip uninstall python_openzwave -y + venv3/bin/pip install -i https://pypi.python.org/pypi -vvv python_openzwave --install-option="--flavor=git" + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv3/bin/pip install -i https://pypi.python.org/pypi -vvv python_openzwave --force --install-option="--flavor=git" + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv3/bin/python venv3/bin/pyozw_check + venv3/bin/python venv3/bin/pyozw_shell --help + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(git-' + venv3/bin/pip uninstall python_openzwave -y + + -rm -f libopenzwave*.so + @echo + @echo "Tests for venv-pypitest-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-pypilive-autobuild-tests: venv-clean + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-pypilive-autobuild-tests." + @echo + @echo + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -Rf venv2/ + virtualenv --python=python2 venv2 + chmod 755 venv2/bin/activate + -rm -f src-lib/libopenzwave/libopenzwave.cpp + -rm -f libopenzwave*.so + venv2/bin/pip install "urwid>=1.1.1" + venv2/bin/pip install "nose" + venv2/bin/pip install -vv python_openzwave + venv2/bin/python venv2/bin/pyozw_check -o raw + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(embed-' + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv2/bin/pip install Cython==0.28.6 +#~ venv2/bin/pip install wheel + venv2/bin/pip uninstall python_openzwave -y + venv2/bin/pip install -vv python_openzwave --upgrade --install-option="--flavor=git" + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv2/bin/python venv2/bin/pyozw_check -o raw + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(git-' + venv2/bin/pip uninstall python_openzwave -y + venv2/bin/pip install -vv python_openzwave --upgrade --install-option="--flavor=ozwdev" + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv2/bin/python venv2/bin/pyozw_check -o raw + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(ozwdev-' + venv2/bin/pip uninstall python_openzwave -y + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -Rf venv3/ + virtualenv --python=python3 venv3 + chmod 755 venv3/bin/activate + -rm -f src-lib/libopenzwave/libopenzwave.cpp + -rm -f libop1enzwave*.so + venv3/bin/pip install "nose" + venv3/bin/pip install "urwid>=1.1.1" + venv3/bin/pip install -vv python_openzwave + venv3/bin/python venv3/bin/pyozw_check -o raw + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(embed-' + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv3/bin/pip install Cython==0.28.6 +#~ venv3/bin/pip install wheel + venv3/bin/pip uninstall python_openzwave -y + venv3/bin/pip install -vv python_openzwave --upgrade --install-option="--flavor=git" + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv3/bin/python venv3/bin/pyozw_check -o raw + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(git-' + venv3/bin/pip uninstall python_openzwave -y + venv3/bin/pip install -vv python_openzwave --upgrade --install-option="--flavor=ozwdev" + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv3/bin/python venv3/bin/pyozw_check -o raw + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(ozwdev-' + venv3/bin/pip uninstall python_openzwave -y + + -rm -f libopenzwave*.so + @echo + @echo "Tests for venv-pypilive-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-git_shared-autobuild-tests: venv-clean venv2 venv3 + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-git_shared-autobuild-tests." + @echo + @echo + + $(MAKE) uninstall + $(MAKE) uninstallso + -pkg-config --libs libopenzwave + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + venv2/bin/python setup-lib.py install --flavor=git_shared + venv2/bin/python setup-api.py install + venv2/bin/python setup-manager.py install + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild + find /usr/local/etc/openzwave -iname device_classes.xml -type f -exec cat '{}' \;|grep open-zwave + test -f venv2/lib/python*/site-packages/libopenzwave*.so + venv2/bin/python venv2/bin/pyozw_check + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(git_shared-' + pkg-config --libs libopenzwave + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + venv3/bin/python setup-lib.py install --flavor=git_shared + venv3/bin/python setup-api.py install +#~ venv3/bin/python setup-manager.py install + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild + find /usr/local/etc/openzwave -iname device_classes.xml -type f -exec cat '{}' \;|grep open-zwave + test -f venv3/lib/python*/site-packages/libopenzwave*.so + venv3/bin/python venv3/bin/pyozw_check + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(git_shared-' + pkg-config --libs libopenzwave + + @echo + @echo + @echo "Tests for venv-git-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-embed-autobuild-tests: venv-clean venv2 venv3 + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-embed-autobuild-tests." + @echo + @echo + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -f libopenzwave*.so + venv2/bin/pip uninstall -y wheel + venv2/bin/pip install "urwid>=1.1.1" + venv2/bin/pip uninstall -y Cython + venv2/bin/python setup.py install --flavor=embed + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + test -f venv2/lib/python*/site-packages/libopenzwave*.so + venv2/bin/python venv2/bin/pyozw_check + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(embed-' + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -f libopenzwave*.so + venv3/bin/pip uninstall -y wheel + venv3/bin/pip install "urwid>=1.1.1" + venv3/bin/pip uninstall -y Cython + venv3/bin/python setup.py install --flavor=embed + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + test -f venv3/lib/python*/site-packages/libopenzwave*.so + venv3/bin/python venv3/bin/pyozw_check + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(embed-' + + -rm -f libopenzwave*.so + @echo + @echo + @echo "Tests for venv-embed-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-embed_shared-autobuild-tests: venv-clean venv2 venv3 + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-embed_shared-autobuild-tests." + @echo + @echo + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -f libopenzwave*.so + venv2/bin/pip install "urwid>=1.1.1" + venv2/bin/pip uninstall -y Cython + venv2/bin/python setup.py install --flavor=embed_shared + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + test -f venv2/lib/python*/site-packages/libopenzwave*.so + venv2/bin/python venv2/bin/pyozw_check + venv2/bin/python venv2/bin/pyozw_check -o raw|grep '(embed_shared-' + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -f libopenzwave*.so + venv3/bin/pip install "urwid>=1.1.1" + venv3/bin/pip uninstall -y Cython + venv3/bin/python setup.py install --flavor=embed_shared + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + test -f venv3/lib/python*/site-packages/libopenzwave*.so + venv3/bin/python venv3/bin/pyozw_check + venv3/bin/python venv3/bin/pyozw_check -o raw|grep '(embed_shared-' + + -rm -f libopenzwave*.so + @echo + @echo + @echo "Tests for venv-embed-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-pypi-autobuild-tests: venv-clean pypi_package + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-pypi-autobuild-tests." + @echo + @echo + + -rm -f dist/*.whl + -rm -Rf tmp/pypi_test/ + -mkdir -p tmp/pypi_test/ + cd tmp/pypi_test/ && unzip ../../$(ARCHIVES)/python_openzwave-${python_openzwave_version}.zip + + virtualenv --python=python2 venv2 + chmod 755 venv2/bin/activate + -rm -f src-lib/libopenzwave/libopenzwave.cpp + -rm -f libopenzwave*.so + venv2/bin/pip install "wheel" + venv2/bin/pip install "urwid>=1.1.1" + venv2/bin/pip install "Cython" + . venv2/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py install + . venv2/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py bdist_wheel --flavor=git + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + virtualenv --python=python3 venv3 + chmod 755 venv3/bin/activate + -rm -f src-lib/libopenzwave/libopenzwave.cpp + -rm -f libop1enzwave*.so + venv3/bin/pip install "wheel" + venv3/bin/pip install "urwid>=1.1.1" + venv3/bin/pip install "Cython" + . venv2/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py install + . venv2/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py bdist_wheel --flavor=git + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + . venv3/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py bdist_wheel --flavor=git + + -mkdir -p dist + cp tmp/pypi_test/python_openzwave/dist/*.whl dist/ + + $(MAKE) venv-bdist_wheel-autobuild-tests + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + . venv2/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py install --force --flavor=git + . venv2/bin/activate && python venv2/bin/pyozw_check + . venv2/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py clean --all --flavor=git + find venv2/lib/ -iname device_classes.xml -type f -print|cat + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + . venv3/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py install --force --flavor=git + . venv3/bin/activate && python venv3/bin/pyozw_check + . venv3/bin/activate && cd tmp/pypi_test/python_openzwave && python setup.py clean --all --flavor=git + find venv3/lib/ -iname device_classes.xml -type f -print|cat + + @echo + @echo + @echo "Tests for venv-pypi-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-bdist_wheel-whl-autobuild-tests: venv-clean venv2 venv3 + @echo ========================================================================================== + @echo + @echo + @echo "Create tests whl for venv-bdist_wheel-autobuild-tests." + @echo + @echo + + -rm -f dist/*.whl + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + venv2/bin/python setup.py install --flavor=git + venv2/bin/python setup.py bdist_wheel --flavor=git + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + venv3/bin/python setup.py install --flavor=git + venv3/bin/python setup.py bdist_wheel --flavor=git + + @echo + @echo + @echo "Tests for venv-bdist_wheel-autobuild-tests created." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-bdist_wheel-autobuild-tests: venv-clean + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-bdist_wheel-autobuild-tests." + @echo + @echo + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -Rf venv2 + virtualenv --python=python2 venv2 + chmod 755 venv2/bin/activate + -rm -f src-lib/libopenzwave/libopenzwave.cpp + -rm -f libopenzwave*.so + + venv2/bin/pip install "wheel" + venv2/bin/pip install "nose" +#~ venv2/bin/pip install "Cython" + venv2/bin/pip install "urwid>=1.1.1" + + venv2/bin/pip install dist/python_openzwave-${python_openzwave_version}-cp2* + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + find venv2/lib/ -iname device_classes.xml -type f -exec cat '{}' \;|grep open-zwave + test -f venv2/lib/python*/site-packages/libopenzwave*.so + venv2/bin/pip uninstall -y "${WHL_PYTHON2}" + #test ! -f venv2/lib/python*/site-packages/libopenzwave*.so + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -Rf venv3 + virtualenv --python=python3 venv3 + chmod 755 venv3/bin/activate + -rm -f src-lib/libopenzwave/libopenzwave.cpp + -rm -f libopenzwave*.so + + venv2/bin/pip install "wheel" + venv3/bin/pip install "nose" +#~ venv3/bin/pip install "Cython" + venv3/bin/pip install "urwid>=1.1.1" + venv3/bin/pip install dist/python_openzwave-${python_openzwave_version}-cp3* + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + find venv3/lib/ -iname device_classes.xml -type f -exec cat '{}' \;|grep open-zwave + test -f venv3/lib/python*/site-packages/libopenzwave*.so + venv3/bin/pip uninstall -y "${WHL_PYTHON3}" + #test ! -f venv3/lib/python*/site-packages/libopenzwave*.so + + @echo + @echo + @echo "Tests for venv-bdist_wheel-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-dev-autobuild-tests: venv-clean venv2 venv3 src-lib/libopenzwave/libopenzwave.cpp + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-dev-autobuild-tests." + @echo + @echo + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -f libopenzwave*.so + #PIP like + venv2/bin/python2 -u -c "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/install-record.txt --single-version-externally-managed --compile --install-headers venv2/include/site/python2.7/python-openzwave "--flavor=git" + + rm -f src-lib/libopenzwave/libopenzwave.cpp + venv2/bin/python setup-lib.py install --flavor=dev + venv2/bin/python setup-api.py install + venv2/bin/python setup-manager.py install + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild tests/manager/autobuild + venv2/bin/python venv2/bin/pyozw_check + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + -rm -f libopenzwave*.so + + #PIP like + venv3/bin/python3 -u -c "import setuptools, tokenize;__file__='setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/install-record.txt --single-version-externally-managed --compile --install-headers venv3/include/site/python3.5/python-openzwave "--flavor=git" + + rm -f src-lib/libopenzwave/libopenzwave.cpp + venv3/bin/python setup-lib.py install --flavor=dev + venv3/bin/python setup-api.py install +#~ venv3/bin/python setup-manager.py install + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild + venv3/bin/python venv3/bin/pyozw_check + + -rm -f libopenzwave*.so + @echo + @echo + @echo "Tests for venv-dev-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +venv-shared-autobuild-tests: venv-clean venv2-shared venv3-shared + @echo ========================================================================================== + @echo + @echo + @echo "Launch tests for venv-shared-autobuild-tests." + @echo + @echo + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python2 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + venv2/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild + venv2/bin/python venv2/bin/pyozw_check + + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + @echo Tests for python3 + @echo + @echo //////////////////////////////////////////////////////////////////////////////////////////// + @echo + + venv3/bin/nosetests --verbose tests/lib/autobuild tests/api/autobuild + venv3/bin/python venv3/bin/pyozw_check + + @echo + @echo + @echo "Tests for venv-shared-autobuild-tests done." + @echo + @echo + @echo ========================================================================================== + @echo + +buildso: openzwave/.lib/ + cd openzwave && $(MAKE) install + +uninstallso: + rm -f /usr/local/lib/x86_64-linux-gnu/pkgconfig/libopenzwave.pc + rm -f /usr/local/lib64/libopenzwave.so.1.4 + rm -f /usr/local/lib64/libopenzwave.so + rm -Rf /usr/local/include/openzwave + rm -Rf /usr/local/etc/openzwave + rm -Rf /usr/local/share/doc/openzwave* + -find /usr/local/lib/pkgconfig/ -iname libopenzwave.pc -delete + +pyozw_pkgconfig.py: + wget https://raw.githubusercontent.com/matze/pkgconfig/master/pkgconfig/pkgconfig.py + mv pkgconfig.py pyozw_pkgconfig.py diff --git a/Makefile.archive b/Makefile.archive index 6bb21727..59789fa6 100644 --- a/Makefile.archive +++ b/Makefile.archive @@ -32,7 +32,7 @@ endif ARCHNAME = python-openzwave-${python_openzwave_version} ARCHDIR = ${ARCHBASE}/${ARCHNAME} -.PHONY: help clean build install uninstall deps +.PHONY: help clean build install uninstall deps install-lib install-api help: @echo "Please use \`make ' where is one of" @@ -42,10 +42,14 @@ help: @echo " uninstall : uninstall python-openzwave" @echo " deps : install needed dependencies" -deps: python-deps deps +deps: python-deps -install-api: +install-lib: ${PYTHON_EXEC} setup-lib.py install + @echo + @echo "Installation of lib finished." + +install-api: install-lib ${PYTHON_EXEC} setup-api.py install @echo @echo "Installation of API finished." @@ -67,8 +71,8 @@ clean: ${PYTHON_EXEC} setup-web.py clean --all --build-base $(BUILDDIR)/web cp -f openzwave.vers.cpp openzwave/cpp/src/vers.cpp -openzwave/libopenzwave.a: - sed -i '253s/.*//' openzwave/cpp/src/value_classes/ValueID.h +openzwave openzwave/.lib/: + sed -i -e '253s/.*//' openzwave/cpp/src/value_classes/ValueID.h cd openzwave && make ###This part is a copy/paste from the original Makefile @@ -105,12 +109,12 @@ uninstall: -rm -Rf /usr/local/share/python-openzwave -rm -Rf /usr/local/share/openzwave -developper-deps: common-deps cython-deps tests-deps pip-deps doc-deps +developer-deps: common-deps cython-deps tests-deps pip-deps doc-deps @echo - @echo "Dependencies for developpers of python-openzwave installed (python ${python_version_full})" + @echo "Dependencies for developers of python-openzwave installed (python ${python_version_full})" autobuild-deps: common-deps cython-deps tests-deps pip-deps - apt-get install -y git + apt-get install --force-yes -y git @echo @echo "Dependencies for autobuilders (docker, travis, ...) installed (python ${python_version_full})" @@ -120,29 +124,29 @@ arch-deps: common-deps pip-deps python-deps: ifeq (${python_version_major},2) - apt-get install -y python2.7 python2.7-dev python2.7-minimal + apt-get install --force-yes -y python2.7 python2.7-dev python2.7-minimal libyaml-dev endif ifeq (${python_version_major},3) - -apt-get install -y python3 python3-dev python3-minimal + -apt-get install --force-yes -y python3 python3-dev python3-minimal libyaml-dev endif cython-deps: ifeq (${python_version_major},2) - apt-get install -y cython + apt-get install --force-yes -y cython endif ifeq (${python_version_major},3) - -apt-get install -y cython3 + -apt-get install --force-yes -y cython3 endif common-deps: @echo Installing dependencies for python : ${python_version_full} ifeq (${python_version_major},2) - apt-get install -y python-pip python-dev python-docutils python-setuptools python-louie + apt-get install --force-yes -y python-pip python-dev python-docutils python-setuptools python-louie endif ifeq (${python_version_major},3) - -apt-get install -y python3-pip python3-docutils python3-dev python3-setuptools + -apt-get install --force-yes -y python3-pip python3-docutils python3-dev python3-setuptools endif - apt-get install -y build-essential libudev-dev g++ + apt-get install --force-yes -y build-essential libudev-dev g++ tests-deps: ${PIP_EXEC} install nose-html @@ -152,7 +156,7 @@ tests-deps: ${PIP_EXEC} install pylint doc-deps: - -apt-get install -y python-sphinx + -apt-get install --force-yes -y python-sphinx ${PIP_EXEC} install sphinxcontrib-blockdiag sphinxcontrib-actdiag sphinxcontrib-nwdiag sphinxcontrib-seqdiag pip-deps: @@ -166,11 +170,7 @@ pip-deps: ###This part is a copy/paste from the original Makefile ### -build: openzwave/libopenzwave.a - ${PYTHON_EXEC} setup-lib.py build --build-base $(BUILDDIR)/lib - ${PYTHON_EXEC} setup-api.py build --build-base $(BUILDDIR)/api - ${PYTHON_EXEC} setup-manager.py build --build-base $(BUILDDIR)/manager - ${PYTHON_EXEC} setup-web.py build --build-base $(BUILDDIR)/web +build: openzwave openzwave/.lib/ ### ###This part is a copy/paste from the original Makefile diff --git a/README.rst b/README.rst index 4a79992b..c4ae7c44 100755 --- a/README.rst +++ b/README.rst @@ -1,3 +1,23 @@ +.. image:: https://travis-ci.org/OpenZWave/python-openzwave.svg?branch=master + :target: https://travis-ci.org/OpenZWave/python-openzwave + :alt: Travis status + +.. image:: https://circleci.com/gh/OpenZWave/python-openzwave.png?style=shield + :target: https://circleci.com/gh/OpenZWave/python-openzwave + :alt: Circle status + +.. image:: https://ci.appveyor.com/api/projects/status/2ogl8tx7o3pqphc9?svg=true + :target: https://ci.appveyor.com/project/bibi21000/python-openzwave + :alt: Appveyor status + +.. image:: https://img.shields.io/pypi/format/python_openzwave.svg + :target: https://pypi.python.org/pypi/python_openzwave + :alt: Pypi format + +.. image:: https://img.shields.io/badge/Documentation-ok-brightgreen.svg?style=flat + :target: http://openzwave.github.io/python-openzwave/index.html + :alt: Documentation + ================ python-openzwave ================ @@ -10,16 +30,215 @@ python-openzwave is a python wrapper for the openzwave c++ library : https://git * a full-event webapp example : flask + socket.io + jquery * a suite of tests * many examples - - -python-openzwave 0.3.0-b4 is out !!! -==================================== -Look at CHANGELOG to see new features and release notes. - -Look at INSTALL_REPO to test it now - -Look at INSTALL_ARCH to install from archive : no need to install cython anymore - + * `Full documentation `_ + +python-openzwave 0.4.x is here !!! +================================== + +- New installation process via pip + +- First, you need some build tools and libs. On ubuntu, you should use : + + .. code-block:: bash + + sudo apt-get install --force-yes -y make libudev-dev g++ libyaml-dev + +- Make your virtualenv and activate it : + + .. code-block:: bash + + virtualenv --python=python3 venv3 + source venv3/bin/activate + +- Install the default flavor : + + .. code-block:: bash + + (venvX) pip install python_openzwave + +- The previous command try to install python_openzwave with the flavor 'shared'. + If it can't find a precompiled library of openzwave, it will use the flavor 'embed' with sources downloaded from https://github.com/OpenZWave/python-openzwave/tree/master/archives. + You can change this using flavor option. + There is a bug in the package dependencies and flavors on some systems. You may need to install dependencies manualy : + + - on python 2.7 : + + .. code-block:: bash + + (venvX) pip install cython wheel six pyserial + (venvX) pip install 'Louie>=1.1' + + - on python 3 : + + .. code-block:: bash + + (venvX) pip install cython wheel six pyserial + (venvX) pip install 'PyDispatcher>=2.0.5' + +- Choose your flavor : + + - embed : the default one. Download sources from https://github.com/OpenZWave/python-openzwave/tree/master/archives and + build them. Python_openzwave is statically build using a cythonized version of libopenzwave. No need to install cython. + - shared : if you have install openzwave as module manually, you can link python_openzwave to it. + - git : download sources from openzwave github and link statically to it. + - embed_shared : download sources from https://github.com/OpenZWave/python-openzwave/tree/master/archives, build and install as module on the system. + Python_openzwave use it. Need root access to install openzwave libs. + - git_shared : download sources from openzwave github, build and install them as module on the system. + Python_openzwave use it. Need root access to install openzwave libs. + - ozwdev and ozwdev_shared : use the dev branch of openzwave on github. + - dev : for python_openzwave developers. Look for openzwave sources in a local folder specified by the LOCAL_OPENZWAVE environment variable (defaults to 'openzwave'). + +- Install it : + + .. code-block:: bash + + (venvX) pip install python_openzwave --no-deps --install-option="--flavor=git" + +- You can update to the last version of openzwave using the git flavor : + + .. code-block:: bash + + (venvX) pip uninstall -y python_openzwave + (venvX) pip install python_openzwave --no-cache-dir --no-deps --install-option="--flavor=git" + + +- At last, you can launch pyozw_check to test your installation : + + If no usb stick is connected to the machine, launch : + + .. code-block:: bash + + (venvX) pyozw_check + + If you've one, use it for advanced checks : + + .. code-block:: bash + + (venvX) pyozw_check -i -d /dev/ttyUSB0 + + .. code-block:: bash + + ------------------------------------------------------------------------------- + Import libs + Try to import libopenzwave + Try to import libopenzwave.PyLogLevels + Try to get options + Try to get manager + Try to get python_openzwave version + 0.4.0.27 + Try to get python_openzwave full version + python-openzwave version 0.4.0.27 (dev / Apr 18 2017 - 23:22:26) + Try to get openzwave version + 1.4.2501 + Try to get default config path + /etc/openzwave/ + Try to import openzwave (API) + ------------------------------------------------------------------------------- + Intialize device /dev/ttyUSB0 + Try to get options + Try to get manager + 2017-04-12 16:41:29.329 Always, OpenZwave Version 1.4.2497 Starting Up + Try to add watcher + ... + 2017-04-12 16:44:05.880 Always, *************************************************************************** + 2017-04-12 16:44:05.880 Always, ********************* Cumulative Network Statistics ********************* + 2017-04-12 16:44:05.880 Always, *** General + 2017-04-12 16:44:05.880 Always, Driver run time: . . . 0 days, 0 hours, 1 minutes + 2017-04-12 16:44:05.880 Always, Frames processed: . . . . . . . . . . . . . . . . . . . . 27 + 2017-04-12 16:44:05.880 Always, Total messages successfully received: . . . . . . . . . . 27 + 2017-04-12 16:44:05.880 Always, Total Messages successfully sent: . . . . . . . . . . . . 19 + 2017-04-12 16:44:05.880 Always, ACKs received from controller: . . . . . . . . . . . . . 19 + 2017-04-12 16:44:05.880 Always, *** Errors + 2017-04-12 16:44:05.880 Always, Unsolicited messages received while waiting for ACK: . . 0 + 2017-04-12 16:44:05.880 Always, Reads aborted due to timeouts: . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, Bad checksum errors: . . . . . . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, CANs received from controller: . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, NAKs received from controller: . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, Out of frame data flow errors: . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, Messages retransmitted: . . . . . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, Messages dropped and not delivered: . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, *************************************************************************** + 2017-04-12 16:44:07.887 Info, mgr, Driver for controller /dev/ttyUSB0 removed + Try to remove watcher + Try to destroy manager + Try to destroy options + + You can list the nodes on your network using : + + .. code-block:: bash + + (venvX) pyozw_check -l -d /dev/ttyUSB0 -t 60 + + .. code-block:: bash + + ------------------------------------------------------------------------------- + Define options for device /dev/ttyUSB0 + Start network + Wait for network (30s) + Network is ready + ------------------------------------------------------------------------------- + Controller capabilities : {'primaryController', 'staticUpdateController'} + Controller node capabilities : {'listening', 'primaryController', 'staticUpdateController', 'beaming'} + Nodes in network : 4 + Driver statistics : {'noack': 6, 'routedbusy': 0, 'readCnt': 115, 'ACKWaiting': 0, 'badChecksum': 0, 'broadcastReadCnt': 0, 'NAKCnt': 0, 'broadcastWriteCnt': 9, 'dropped': 0, 'CANCnt': 0, 'callbacks': 0, 'OOFCnt': 0, 'readAborts': 0, 'badroutes': 0, 'SOFCnt': 115, 'netbusy': 0, 'writeCnt': 49, 'nondelivery': 0, 'ACKCnt': 49, 'retries': 0} + ------------------------------------------------------------ + 1 - Name : ( Location : ) + 1 - Ready : True / Awake : True / Failed : False + 1 - Manufacturer : Aeotec ( id : 0x0086 ) + 1 - Product : DSA02203 Z-Stick S2 ( id : 0x0001 / type : 0x0002 ) + 1 - Version : 3 / Secured : False / Zwave+ : False + 1 - Command classes : {'COMMAND_CLASS_NO_OPERATION', 'COMMAND_CLASS_BASIC'} + 1 - Capabilities : {'staticUpdateController', 'listening', 'primaryController', 'beaming'} + 1 - Neigbors : {4} / Power level : None + 1 - Is sleeping : False / Can wake-up : False / Battery level : None + + ... + + ------------------------------------------------------------ + 4 - Name : ( Location : ) + 4 - Ready : True / Awake : True / Failed : False + 4 - Manufacturer : GreenWave ( id : 0x0099 ) + 4 - Product : PowerNode 6 port ( id : 0x0004 / type : 0x0003 ) + 4 - Version : 4 / Secured : False / Zwave+ : False + 4 - Command classes : {'COMMAND_CLASS_BASIC', 'COMMAND_CLASS_CONFIGURATION', 'COMMAND_CLASS_SWITCH_BINARY', 'COMMAND_CLASS_VERSION', 'COMMAND_CLASS_CRC_16_ENCAP', 'COMMAND_CLASS_MANUFACTURER_SPECIFIC', 'COMMAND_CLASS_ASSOCIATION', 'COMMAND_CLASS_MULTI_INSTANCE/CHANNEL', 'COMMAND_CLASS_METER', 'COMMAND_CLASS_PROTECTION', 'COMMAND_CLASS_NO_OPERATION', 'COMMAND_CLASS_SWITCH_ALL'} + 4 - Capabilities : {'listening', 'routing', 'beaming'} + 4 - Neigbors : {1} / Power level : None + 4 - Is sleeping : False / Can wake-up : False / Battery level : None + + ... + + + - The old manager is now available via the pyozw_shell command. You need to install module "urwid>=1.1.1" with pip before using it. + + - libopenzwave and openzwave python modules are packaged in the python_openzwave. + So developers needs to update their install_requires (it works fine with pyozw_manager). + They can use the following code to update softly : + + .. code-block:: python + + pyozw_version='0.4.1' + + def install_requires(): + try: + import python_openzwave + return ['python_openzwave==%s' % pyozw_version] + except ImportError: + pass + try: + import libopenzwave + return ['openzwave==%s' % pyozw_version] + except ImportError: + pass + return ['python_openzwave == %s' % pyozw_version] + + + - If you already have an 0.3.x version installed, you should update your installation as usual. Don't install it with pip as it can break your installation (maybe not if you don't remove old modules) + + - Support for windows, macosx, ... is not tested. Feel free to report bug and patches. We can try to support these plateforms. Don't have Windows at home so I can't help. Same for mac. + + - Old installation process is deprecated and reserved for python-openzwave-developers and alternatives machines. + + - Please report your successful installations here : https://github.com/OpenZWave/python-openzwave/issues/73 Support ======= @@ -27,87 +246,7 @@ You can ask for support on the google group : http://groups.google.com/d/forum/p Please don't ask for support in github issues or by email. - Pull requests ============= Please read DEVEL documentation before submitting pull request. A lot of project tasks are done automatically or with makefile, so they must be done in a certain place or in a special order. - -Migrating from python-openzwave 0.2.X to 0.3.0 -============================================== -I need to update source tree of python-openzwave and modules's names because of a bug in setuptools : https://bitbucket.org/pypa/setuptools/issue/230/develop-mode-does-not-respect-src . -Sorry for that. - -Update your sources: - -.. code-block:: bash - - git pull - -Before building python-openzwave 0.3.0, you must uninstall the old version : - -.. code-block:: bash - - sudo make uninstall - -About cython : I've made many tests using cython installed via pip : (0.20, 0.21 and 0.22). -Compilation is ok but a segfault appears when launching the tests. Please remove it. - -.. code-block:: bash - - sudo pip uninstall Cython - -You also need to make some minor updates in you code, look at CHANGELOG - -If you have problems, please submit an issue with : - - - cython -V - - the content of the directory /usr/local/lib/python2.7/dist-packages/ (for python2.7) - - the content of /usr/local/lib/python2.7/dist-packages/easy-install.pth (for python 2.7) - - -Ubuntu 64bits ... and the others -================================ - -If you're using Ubuntu 64 bits (and mayde others) and keep your distribution up to date, -you certainly have the segfault problem : https://github.com/OpenZWave/python-openzwave/issues/121 - -It appears with the last update of python : - -.. code-block:: bash - - $ python - Python 2.7.6 (default, Jun 22 2015, 17:58:13) - [GCC 4.8.2] on linux2 - Type "help", "copyright", "credits" or "license" for more information. - - -I've open a discussion on cython-users here : https://groups.google.com/forum/#!topic/cython-users/mRsviGuCFOk - -The only way I found to avoid this is to rebuild and reinstall the old release of python : - -.. code-block:: bash - - wget https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6-8.dsc https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6.orig.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6-8.diff.gz - - dpkg-source -x python2.7_2.7.6-8.dsc - - sudo apt-get build-dep python2.7 - - cd python2.7-2.7.6 - - dpkg-buildpackage - -Wait, wait and await again :) - -.. code-block:: bash - - cd .. - - sudo dpkg -i *.deb - -To prevent future updates of python, you could mark its packages. For example, if you use apt to update your distribution, use the following command : - -.. code-block:: bash - - sudo apt-mark hold idle-python2.7 libpython2.7-minimal python2.7-dbg python2.7-minimal libpython2.7 libpython2.7-stdlib python2.7-dev libpython2.7-dbg libpython2.7-testsuite python2.7-doc libpython2.7-dev python2.7 python2.7-examples diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..0dfab890 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,140 @@ +environment: + PYPI_USER: + secure: yna6KiH2GE3Ka1G5a3TlUQ== + PYPI_PASSWORD: + secure: UpISOsYyHdCzurReV6FcTA== + + global: + # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the + # /E:ON and /V:ON options are not enabled in the batch script intepreter + # See: http://stackoverflow.com/a/13751649/163740 + CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd" + + matrix: + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python36" + PYTHON_VERSION: "3.6.x" + PYTHON_ARCH: "32" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python36-x64" + PYTHON_VERSION: "3.6.x" + PYTHON_ARCH: "64" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python27" + PYTHON_VERSION: "2.7.x" + PYTHON_ARCH: "32" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python27-x64" + PYTHON_VERSION: "2.7.x" + PYTHON_ARCH: "64" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python34" + PYTHON_VERSION: "3.4.x" + PYTHON_ARCH: "32" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python34-x64" + PYTHON_VERSION: "3.4.x" + PYTHON_ARCH: "64" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python37" + PYTHON_VERSION: "3.7.x" + PYTHON_ARCH: "32" + + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + PYTHON: "C:\\Python37-x64" + PYTHON_VERSION: "3.7.x" + PYTHON_ARCH: "64" + +deploy: + - provider: Environment + name: production + on: + APPVEYOR_REPO_TAG: true + +install: + # If there is a newer build queued for the same PR, cancel this one. + # The AppVeyor 'rollout builds' option is supposed to serve the same + # purpose but it is problematic because it tends to cancel builds pushed + # directly to master instead of just PR builds (or the converse). + # credits: JuliaLang developers. + - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` + https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | ` + Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` + throw "There are newer queued builds for this pull request, failing early." } + - ECHO "Filesystem root:" + - ps: "ls \"C:/\"" + + #~ - ECHO "Installed SDKs:" + #~ - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\"" + + - ECHO "Installed prgrams:" + - ps: "ls \"C:/Program Files/\"" + - ps: "ls \"C:/Program Files (x86)/\"" + - ps: "ls \"C:/Program Files (x86)/MSBuild/\"" + - ps: "ls \"C:/Program Files (x86)/Windows Kits/\"" + + # Prepend newly installed Python to the PATH of this build (this cannot be + # done from inside the powershell script as it would require to restart + # the parent CMD process). + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" + + # Check that we have the expected version and architecture for Python + - "python --version" + - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" + + # Upgrade to the latest version of pip to avoid it displaying warnings + # about it being out of date. + - "python -m pip install --disable-pip-version-check --user --upgrade pip" + + # Install the build dependencies of the project. If some dependencies contain + # compiled extensions and are not provided as pre-built wheel packages, + # pip will build them from source using the MSVC compiler matching the + # target Python version and architecture + # - "%CMD_IN_ENV% pip install Cython six" + - "python -m pip install wheel" + - "python -m pip install pyserial" + - "python -m pip install Cython six" + - "python -m pip install nose" + - "python -m pip install twine" + + - ps: Write-Host "PYTHON_VERSION $env:PYTHON_VERSION" + + - cmd: IF "%PYTHON_VERSION%" == "2.7.x" ( python -m pip install Louie ) ELSE ( python -m pip install PyDispatcher ) + + - git clone git://github.com/OpenZWave/open-zwave.git C:\projects\python-openzwave\openzwave + +build_script: + # Build the compiled extension + # "python pyozw_win.py" + - "python setup.py install --flavor=dev" + +test_script: + # Run the project tests + - "pyozw_check" + - "nosetests --verbose tests/lib/autobuild tests/api/autobuild" + +after_test: + # If tests are successful, create binary packages for the project. + - python setup.py bdist_wheel --flavor=dev + #~ - "python setup.py bdist_wininst" + #~ - "%CMD_IN_ENV% python setup.py bdist_msi" + - ps: "ls dist" + +artifacts: + # Archive the generated packages in the ci.appveyor.com build report. + - path: dist/* + name: windowswheels + +deploy_script: + # upload to pypi for Windows + - cmd: IF "%APPVEYOR_REPO_TAG%" == "true" (echo "Uploading wheels") + - cmd: IF "%APPVEYOR_REPO_TAG%" == "true" (set HOME=%USERPROFILE%) + - cmd: IF "%APPVEYOR_REPO_TAG%" == "true" (twine upload dist/*.whl --repository-url https://upload.pypi.org/legacy/ -u %PYPI_USER% -p %PYPI_PASSWORD%) + - cmd: IF "%APPVEYOR_REPO_TAG%" == "true" (echo "Finished Artifact Deployment" ) diff --git a/archives/README.rst b/archives/README.rst new file mode 100755 index 00000000..9e703d84 --- /dev/null +++ b/archives/README.rst @@ -0,0 +1,5 @@ +========================= +python-openzwave archives +========================= + +Look at INSTALL_ARCH.txt to use these archives. diff --git a/archives/open-zwave-master-0.4.0.27.zip b/archives/open-zwave-master-0.4.0.27.zip new file mode 100644 index 00000000..5263c90b Binary files /dev/null and b/archives/open-zwave-master-0.4.0.27.zip differ diff --git a/archives/open-zwave-master-0.4.0.28.zip b/archives/open-zwave-master-0.4.0.28.zip new file mode 100644 index 00000000..00f1b9bd Binary files /dev/null and b/archives/open-zwave-master-0.4.0.28.zip differ diff --git a/archives/open-zwave-master-0.4.0.29.zip b/archives/open-zwave-master-0.4.0.29.zip new file mode 100644 index 00000000..b1184588 Binary files /dev/null and b/archives/open-zwave-master-0.4.0.29.zip differ diff --git a/archives/open-zwave-master-0.4.0.30.zip b/archives/open-zwave-master-0.4.0.30.zip new file mode 100644 index 00000000..7a8922c5 Binary files /dev/null and b/archives/open-zwave-master-0.4.0.30.zip differ diff --git a/archives/open-zwave-master-0.4.0.31.zip b/archives/open-zwave-master-0.4.0.31.zip new file mode 100644 index 00000000..8854927c Binary files /dev/null and b/archives/open-zwave-master-0.4.0.31.zip differ diff --git a/archives/open-zwave-master-0.4.0.32.zip b/archives/open-zwave-master-0.4.0.32.zip new file mode 100644 index 00000000..9f3e01b6 Binary files /dev/null and b/archives/open-zwave-master-0.4.0.32.zip differ diff --git a/archives/open-zwave-master-0.4.0.33.zip b/archives/open-zwave-master-0.4.0.33.zip new file mode 100644 index 00000000..6c851ab4 Binary files /dev/null and b/archives/open-zwave-master-0.4.0.33.zip differ diff --git a/archives/open-zwave-master-0.4.0.34.zip b/archives/open-zwave-master-0.4.0.34.zip new file mode 100644 index 00000000..fdf798ec Binary files /dev/null and b/archives/open-zwave-master-0.4.0.34.zip differ diff --git a/archives/open-zwave-master-0.4.0.35.zip b/archives/open-zwave-master-0.4.0.35.zip new file mode 100644 index 00000000..f56a9ca4 Binary files /dev/null and b/archives/open-zwave-master-0.4.0.35.zip differ diff --git a/archives/open-zwave-master-0.4.1.zip b/archives/open-zwave-master-0.4.1.zip new file mode 100644 index 00000000..676c2903 Binary files /dev/null and b/archives/open-zwave-master-0.4.1.zip differ diff --git a/archives/open-zwave-master-0.4.10.zip b/archives/open-zwave-master-0.4.10.zip new file mode 100644 index 00000000..9b9898ad Binary files /dev/null and b/archives/open-zwave-master-0.4.10.zip differ diff --git a/archives/open-zwave-master-0.4.11.zip b/archives/open-zwave-master-0.4.11.zip new file mode 100644 index 00000000..2247bde9 Binary files /dev/null and b/archives/open-zwave-master-0.4.11.zip differ diff --git a/archives/open-zwave-master-0.4.14.zip b/archives/open-zwave-master-0.4.14.zip new file mode 100644 index 00000000..b84d0d8b Binary files /dev/null and b/archives/open-zwave-master-0.4.14.zip differ diff --git a/archives/open-zwave-master-0.4.15.zip b/archives/open-zwave-master-0.4.15.zip new file mode 100644 index 00000000..12e55244 Binary files /dev/null and b/archives/open-zwave-master-0.4.15.zip differ diff --git a/archives/open-zwave-master-0.4.16.zip b/archives/open-zwave-master-0.4.16.zip new file mode 100644 index 00000000..670b7f68 Binary files /dev/null and b/archives/open-zwave-master-0.4.16.zip differ diff --git a/archives/open-zwave-master-0.4.17.zip b/archives/open-zwave-master-0.4.17.zip new file mode 100644 index 00000000..ffa36699 Binary files /dev/null and b/archives/open-zwave-master-0.4.17.zip differ diff --git a/archives/open-zwave-master-0.4.18.zip b/archives/open-zwave-master-0.4.18.zip new file mode 100644 index 00000000..9897a92f Binary files /dev/null and b/archives/open-zwave-master-0.4.18.zip differ diff --git a/archives/open-zwave-master-0.4.19.zip b/archives/open-zwave-master-0.4.19.zip new file mode 100644 index 00000000..62b61c1d Binary files /dev/null and b/archives/open-zwave-master-0.4.19.zip differ diff --git a/archives/open-zwave-master-0.4.2.zip b/archives/open-zwave-master-0.4.2.zip new file mode 100644 index 00000000..14c251aa Binary files /dev/null and b/archives/open-zwave-master-0.4.2.zip differ diff --git a/archives/open-zwave-master-0.4.3.zip b/archives/open-zwave-master-0.4.3.zip new file mode 100644 index 00000000..9e3568d8 Binary files /dev/null and b/archives/open-zwave-master-0.4.3.zip differ diff --git a/archives/open-zwave-master-0.4.4.zip b/archives/open-zwave-master-0.4.4.zip new file mode 100644 index 00000000..826ac8e3 Binary files /dev/null and b/archives/open-zwave-master-0.4.4.zip differ diff --git a/archives/open-zwave-master-0.4.5.zip b/archives/open-zwave-master-0.4.5.zip new file mode 100644 index 00000000..c9a94777 Binary files /dev/null and b/archives/open-zwave-master-0.4.5.zip differ diff --git a/archives/open-zwave-master-0.4.6.zip b/archives/open-zwave-master-0.4.6.zip new file mode 100644 index 00000000..c26caf17 Binary files /dev/null and b/archives/open-zwave-master-0.4.6.zip differ diff --git a/archives/open-zwave-master-0.4.7.zip b/archives/open-zwave-master-0.4.7.zip new file mode 100644 index 00000000..10e0a163 Binary files /dev/null and b/archives/open-zwave-master-0.4.7.zip differ diff --git a/archives/open-zwave-master-0.4.8.zip b/archives/open-zwave-master-0.4.8.zip new file mode 100644 index 00000000..f5d3cb1e Binary files /dev/null and b/archives/open-zwave-master-0.4.8.zip differ diff --git a/archives/open-zwave-master-0.4.9.zip b/archives/open-zwave-master-0.4.9.zip new file mode 100644 index 00000000..f8899041 Binary files /dev/null and b/archives/open-zwave-master-0.4.9.zip differ diff --git a/archives/python-openzwave-0.3.2.tgz b/archives/python-openzwave-0.3.2.tgz new file mode 100644 index 00000000..82a96ec4 Binary files /dev/null and b/archives/python-openzwave-0.3.2.tgz differ diff --git a/archives/python-openzwave-0.3.3.tgz b/archives/python-openzwave-0.3.3.tgz new file mode 100644 index 00000000..f5ad69fb Binary files /dev/null and b/archives/python-openzwave-0.3.3.tgz differ diff --git a/archives/python_openzwave-0.4.0.27.zip b/archives/python_openzwave-0.4.0.27.zip new file mode 100644 index 00000000..c1928219 Binary files /dev/null and b/archives/python_openzwave-0.4.0.27.zip differ diff --git a/archives/python_openzwave-0.4.0.28.zip b/archives/python_openzwave-0.4.0.28.zip new file mode 100644 index 00000000..41b2ac22 Binary files /dev/null and b/archives/python_openzwave-0.4.0.28.zip differ diff --git a/archives/python_openzwave-0.4.0.29.zip b/archives/python_openzwave-0.4.0.29.zip new file mode 100644 index 00000000..6f0c8a0f Binary files /dev/null and b/archives/python_openzwave-0.4.0.29.zip differ diff --git a/archives/python_openzwave-0.4.0.30.zip b/archives/python_openzwave-0.4.0.30.zip new file mode 100644 index 00000000..1750bcc5 Binary files /dev/null and b/archives/python_openzwave-0.4.0.30.zip differ diff --git a/archives/python_openzwave-0.4.0.31.zip b/archives/python_openzwave-0.4.0.31.zip new file mode 100644 index 00000000..ff002623 Binary files /dev/null and b/archives/python_openzwave-0.4.0.31.zip differ diff --git a/archives/python_openzwave-0.4.0.32.zip b/archives/python_openzwave-0.4.0.32.zip new file mode 100644 index 00000000..5e9e4b68 Binary files /dev/null and b/archives/python_openzwave-0.4.0.32.zip differ diff --git a/archives/python_openzwave-0.4.0.33.zip b/archives/python_openzwave-0.4.0.33.zip new file mode 100644 index 00000000..21013607 Binary files /dev/null and b/archives/python_openzwave-0.4.0.33.zip differ diff --git a/archives/python_openzwave-0.4.0.34.zip b/archives/python_openzwave-0.4.0.34.zip new file mode 100644 index 00000000..f4a5a89a Binary files /dev/null and b/archives/python_openzwave-0.4.0.34.zip differ diff --git a/archives/python_openzwave-0.4.0.35.zip b/archives/python_openzwave-0.4.0.35.zip new file mode 100644 index 00000000..1d1cb64b Binary files /dev/null and b/archives/python_openzwave-0.4.0.35.zip differ diff --git a/archives/python_openzwave-0.4.1.zip b/archives/python_openzwave-0.4.1.zip new file mode 100644 index 00000000..a2925d22 Binary files /dev/null and b/archives/python_openzwave-0.4.1.zip differ diff --git a/archives/python_openzwave-0.4.10.zip b/archives/python_openzwave-0.4.10.zip new file mode 100644 index 00000000..7762b7ff Binary files /dev/null and b/archives/python_openzwave-0.4.10.zip differ diff --git a/archives/python_openzwave-0.4.11.zip b/archives/python_openzwave-0.4.11.zip new file mode 100644 index 00000000..9ab4b224 Binary files /dev/null and b/archives/python_openzwave-0.4.11.zip differ diff --git a/archives/python_openzwave-0.4.14.zip b/archives/python_openzwave-0.4.14.zip new file mode 100644 index 00000000..31798f3d Binary files /dev/null and b/archives/python_openzwave-0.4.14.zip differ diff --git a/archives/python_openzwave-0.4.15.zip b/archives/python_openzwave-0.4.15.zip new file mode 100644 index 00000000..d341a2e2 Binary files /dev/null and b/archives/python_openzwave-0.4.15.zip differ diff --git a/archives/python_openzwave-0.4.16.zip b/archives/python_openzwave-0.4.16.zip new file mode 100644 index 00000000..c08369f2 Binary files /dev/null and b/archives/python_openzwave-0.4.16.zip differ diff --git a/archives/python_openzwave-0.4.17.zip b/archives/python_openzwave-0.4.17.zip new file mode 100644 index 00000000..f1008c65 Binary files /dev/null and b/archives/python_openzwave-0.4.17.zip differ diff --git a/archives/python_openzwave-0.4.18.zip b/archives/python_openzwave-0.4.18.zip new file mode 100644 index 00000000..4dafdcfd Binary files /dev/null and b/archives/python_openzwave-0.4.18.zip differ diff --git a/archives/python_openzwave-0.4.19.zip b/archives/python_openzwave-0.4.19.zip new file mode 100644 index 00000000..0c9cafef Binary files /dev/null and b/archives/python_openzwave-0.4.19.zip differ diff --git a/archives/python_openzwave-0.4.2.zip b/archives/python_openzwave-0.4.2.zip new file mode 100644 index 00000000..f79ae946 Binary files /dev/null and b/archives/python_openzwave-0.4.2.zip differ diff --git a/archives/python_openzwave-0.4.3.zip b/archives/python_openzwave-0.4.3.zip new file mode 100644 index 00000000..dc37d2e6 Binary files /dev/null and b/archives/python_openzwave-0.4.3.zip differ diff --git a/archives/python_openzwave-0.4.4.zip b/archives/python_openzwave-0.4.4.zip new file mode 100644 index 00000000..ec98edc5 Binary files /dev/null and b/archives/python_openzwave-0.4.4.zip differ diff --git a/archives/python_openzwave-0.4.5.zip b/archives/python_openzwave-0.4.5.zip new file mode 100644 index 00000000..db6317d6 Binary files /dev/null and b/archives/python_openzwave-0.4.5.zip differ diff --git a/archives/python_openzwave-0.4.6.zip b/archives/python_openzwave-0.4.6.zip new file mode 100644 index 00000000..9c6fa0f8 Binary files /dev/null and b/archives/python_openzwave-0.4.6.zip differ diff --git a/archives/python_openzwave-0.4.7.zip b/archives/python_openzwave-0.4.7.zip new file mode 100644 index 00000000..e0c43de7 Binary files /dev/null and b/archives/python_openzwave-0.4.7.zip differ diff --git a/archives/python_openzwave-0.4.8.zip b/archives/python_openzwave-0.4.8.zip new file mode 100644 index 00000000..26d47a4c Binary files /dev/null and b/archives/python_openzwave-0.4.8.zip differ diff --git a/archives/python_openzwave-0.4.9.zip b/archives/python_openzwave-0.4.9.zip new file mode 100644 index 00000000..51918e6a Binary files /dev/null and b/archives/python_openzwave-0.4.9.zip differ diff --git a/circle.yml b/circle.yml new file mode 100644 index 00000000..a375e575 --- /dev/null +++ b/circle.yml @@ -0,0 +1,21 @@ +##### +# Circle CI +# +# For running docker images on circle ci, see: https://circleci.com/docs/docker +# For circle.yml explanation, see: https://circleci.com/docs/manually +# Python specific configuration, see: https://circleci.com/docs/language-python +##### +machine: + python: + version: 2.7.6 + version: 3.5.3 + version: pypy-2.3.1 +dependencies: + override: + - sudo apt-get update + - sudo make ci-deps + - make openzwave.gzip + - echo "Don't need to install setup.py" +test: + override: + - make venv-continuous-autobuild-tests diff --git a/debian/changelog b/debian/changelog index 8fc6f734..8744ed4c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,45 @@ -python-openzwave (0.3.0-beta3) UNRELEASED; urgency=medium +python-openzwave (0.4.19) UNRELEASED; urgency=medium + + * Try to fix + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + * Automatic release from upstream. Look at CHANGELOG.txt + + -- bibi21000 Wed, 20 Mar 2019 10:57:44 +0100 + +python-openzwave (0.3.0b8) UNRELEASED; urgency=medium * Automatic release from upstream + * Automatic release from upstream + * Automatic release from upstream + * Automatic release from upstream + * Automatic release from upstream - -- bibi21000 Tue, 16 Jun 2015 00:18:00 +0200 + -- bibi21000 Tue, 08 Dec 2015 23:41:03 +0100 python-openzwave (0.3.0-alpha3) oneiric; urgency=low diff --git a/debian/control b/debian/control index b34efcf9..82b3dd09 100755 --- a/debian/control +++ b/debian/control @@ -2,53 +2,33 @@ Source: python-openzwave Section: python Priority: optional Maintainer: Sébastien GALLET +Build-Depends: debhelper (>= 9), dh-python, + python-all (>=2.6.6-3~), python-setuptools, python-pip, + python3-all (>=3.2), python3-setuptools, python3-pip, + cython, cython3, build-essential, + python-docutils, python-sphinx, + libopenzwave1.4-dev | libopenzwave1.3-dev +Standards-Version: 3.9.5 X-Python-Version: >= 2.7 -Build-Depends: debhelper (>= 7.0.50~), python (>= 2.6.6-3~), python-setuptools, - python-dev, cython, build-essential, libopenzwave1.0-dev|libopenzwave1.3-dev -Build-Depends-Indep: debhelper (>= 7.0.50~), python (>= 2.6.6-3~), python-setuptools, - python-dev, python-pygraphviz, python-louie, sphinx-common, - python-sphinxcontrib.actdiag, python-sphinxcontrib.blockdiag, - python-sphinxcontrib.nwdiag, python-sphinxcontrib.seqdiag -Standards-Version: 3.9.1 +X-Python3-Version: >= 3.2 +XS-Python-Version: >= 2.7 +XS-Python3-Version: >= 3.2 Homepage: https://github.com/OpenZWave/python-openzwave -Package: python-openzwave-lib -Architecture: any -Depends: libopenzwave1.0|libopenzwave1.3, python, ${misc:Depends}, ${python:Depends} -Description: python-openzwave is another python wrapper around the openzwave project. - The wrapper allows you to control a z-wave network from python. - The one-to-one library is in beta state. You can try it. - The new wrapper is in early developpement stage. So don't use it, but -Package: python-openzwave-api -Architecture: all -Depends: libopenzwave1.0|libopenzwave1.3, python-louie, python-openzwave-lib (= ${binary:Version}), ${misc:Depends}, ${python:Depends} -Suggests: python-pysqlite2 -Description: python-openzwave is another python wrapper around the openzwave project. +Package: python-openzwave +Architecture: any +Depends: ${misc:Depends}, ${python:Depends} +Description: python-openzwave is a python wrapper for the openzwave project. The wrapper allows you to control a z-wave network from python. - The one-to-one library is in beta state. You can try it. - The new wrapper is in early developpement stage. So don't use it, but + . + This package installs the library for Python 2. -Package: python-openzwave-manager -Architecture: all -Depends: python-openzwave-api (= ${binary:Version}), python-urwid -Description: A command line manager for your ZWave Network. - You can : - * Reset controller (hard and soft) and add/remove device/controller - * Change node informations (name, location, ... ) - * view and change values informations - * view and change group informations - * view and change config parameters - * view and change gassociations - * Full management of scenes, switches, dimmers and sensors -Package: python-openzwave-web -Architecture: all -Depends: python-openzwave-api (= ${binary:Version}), python-flask, python-flaskext.wtf, python-flask-babel, python-socketio -Description: The webapp. - Work in progress - -Package: python-openzwave-doc -Architecture: all -Description: Documentation for python-openzwave. - HTML format +Package: python3-openzwave +Architecture: any +Depends: ${misc:Depends}, ${python3:Depends} +Description: python-openzwave is a python wrapper for the openzwave project. + The wrapper allows you to control a z-wave network from python. + . + This package installs the library for Python 3. diff --git a/debian/docs b/debian/docs old mode 100755 new mode 100644 index 8b137891..3075e64c --- a/debian/docs +++ b/debian/docs @@ -1 +1,3 @@ - +README.rst +LICENSE.txt +CHANGELOG.txt diff --git a/debian/python-openzwave-doc.docs b/debian/python-openzwave-doc.docs deleted file mode 100755 index 91efdaab..00000000 --- a/debian/python-openzwave-doc.docs +++ /dev/null @@ -1,3 +0,0 @@ -docs/_build/html -docs/_build/text/CHANGELOG.txt -docs/_build/text/README.txt diff --git a/debian/rules b/debian/rules index a826ea04..acb1bdc9 100755 --- a/debian/rules +++ b/debian/rules @@ -1,27 +1,29 @@ -#!/usr/bin/make -f +#! /usr/bin/make -f -%: - dh $@ --with python2 +#export DH_VERBOSE = 1 +export PYBUILD_NAME = openzwave + +export PYBUILD_INSTALL_ARGS=--flavor=shared + +export PYBUILD_DESTDIR_python2=debian/python-openzwave/ +export PYBUILD_DESTDIR_python2-dbg=debian/python-openzwave-dbg/ +export PYBUILD_DESTDIR_python3=debian/python3-openzwavefoo/ +export PYBUILD_DESTDIR_python3-dbg=debian/python3-openzwave-dbg/ +export PYBUILD_DESTDIR_pypy=debian/pypy-openzwave/ +override_dh_auto_clean: + make clean + -rm -rf venv* + -rm -rf openzwave* + -rm -rf dist + -rm -rf dists + -rm -rf archives + override_dh_auto_build: - python setup-lib.py build --debian-package -override_dh_auto_install: - python setup-lib.py install --root=debian/python-openzwave-lib/ --install-layout=deb --debian-package - rm -rf debian/python-openzwave-lib/usr/config - rm -rf build - python setup-api.py install --root=debian/python-openzwave-api/ --install-layout=deb --debian-package - rm -rf build - python setup-manager.py install --root=debian/python-openzwave-manager/ --install-layout=deb --debian-package - rm -rf build - python setup-web.py install --root=debian/python-openzwave-web/ --install-layout=deb --debian-package - python setup-lib.py develop --debian-package - python setup-api.py develop --debian-package - python setup-manager.py develop --debian-package - python setup-web.py develop --debian-package - cd docs && make html - cd docs && make text - python setup-lib.py develop --uninstall - python setup-api.py develop --uninstall - python setup-manager.py develop --uninstall - python setup-web.py develop --uninstall +override_dh_auto_configure: + +override_dh_auto_test: + +%: + dh $@ --with python2,python3 --buildsystem=pybuild diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 6cadbd15..ec9d1b02 100755 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -3,14 +3,136 @@ ========= Changelog ========= + +python_openzwave 0.4.18.x: + * Fix python 2.7/appveyor + * Add serial port auto-detection -Known bugs - * reloader problem : the network stop/start every time the app is realoaded. But in this case, the process terminates normally. - But there seems to be 2 running instances of the network. +python_openzwave 0.4.17.x: + * Add wheels for Windows + + +python_openzwave 0.4.16.x: + * Fix appveyor build for windows + + +python_openzwave 0.4.15.x: + * Update embeded package + + +python_openzwave 0.4.14.x: + * Use Cython 0.28.6 + * Update embeded package + + +python_openzwave 0.4.12.x: + * Improve support Windows + * COMMAND_CLASS_ZWAVE_PLUS_INFO renamed to COMMAND_CLASS_ZWAVEPLUS_INFO + * Update thermostat + * Update embeded package + + +python_openzwave 0.4.11.x: + * Update embeded package + + +python_openzwave 0.4.10.x: + * Improve support Windows in pip + * Improve tests Windows + * Update contructors for scenes and groups + + +python_openzwave 0.4.9.x: + * Improve support Windows in pip + * Update tests + + +python_openzwave 0.4.6.x: + * First try to support Windows in pip + + +python_openzwave 0.4.5.x: + * Fix bug in node statistics and add test. + * Update Makefile to build flavor dev + * Update pyozw_check. + * Update default flavor : check cython is here before choosing shared + * Fix controller.update_ozw_config when directory isn't writable + + +python_openzwave 0.4.4.x: + * Add new options to pyozw_check to list nodes on network. + + +python_openzwave 0.4.3.x: + * Fix bug in default flavor. + + +python_openzwave 0.4.1.x: + * Update the default flavor : try to use a precompiled library. If can't find one, use the embeded package. + * Add method to controller to get new config from github. + + +python_openzwave 0.4.0.x: + + * New installation process via pip + * Update your install_requires : both libopenzwave, openzwave and the manager are merged in python_openzwave package on pypi. Don't need to update your imports in code. + * There will be major updates in the next releases, it's safe to use python_openzwave>0.4.0 and python_openzwave<0.5 in your requires. + * Remove old versions of libopenzwave and openzwave before you update your installation with new pip process ... or not. + * You can use the old installation process (via github), it's the one I use to develop. + * Installation via archive method is no longer suppored (no release for 0.4.0). Use pip instead with --flavor embed option. + * Default mode is embed now. + * Update config path discovery : check for 'device_classes.xml' in /etc/openzwave/, /usr/local/etc/openzwave/ and + finally in ozw_config in python_openzwave module. + * Add flavor : different ways of building and installing openzwave / python_openzwave. + * Add infos on flavor / build date to getPythonLibraryVersion + * Improve installation on micro machines : embed_shared build and install openzwave/python_openzwave in 8 minutes on a raspberry pi 3 + * Add ozwdev and ozwdev_shared flavors : use openzwave dev branch instead of master + * Rename to COMMAND_CLASS_MULTI_CHANNEL_V2 to COMMAND_CLASS_MULTI_INSTANCE/CHANNEL + * Add tests for c++ library sync + * Add door locks helpers + * Add helpers for config parameters + * Add data_items to value's dict + + +python-openzwave 0.3.3: + + * Openzwave update + * Update values getter in nodes. See #70 + * Fix setvalue for string types in python3 + + +python-openzwave 0.3.2: + + * Openzwave update + * Add thermostat + * Add patch from https://github.com/ebisso/python-openzwave/commit/8776daccc730cb5d7f71a178e9e0cc1d191ad115 + * Can compile dynamically + + +python-openzwave 0.3.1: + + * Fix bugs and openzwave update + + +python-openzwave 0.3.0: + + * Fix bugs and openzwave update + + +python-openzwave 0.3.0-beta8: + + * Add multi instance support + * Update GROUP notification : please update your code to add the new parameter + * Update VALUE_REMOVED notification : please update your code to add the new parameter + * Improve unicode : you may need to delete your old config file + * Add Python 3 support + * Improve controllers_command : add a lock and a way to retrieve current status + * Add support for RGB bulbs python-openzwave 0.3.0-beta3: + * Add security rewrite support. See https://groups.google.com/forum/#!msg/openzwave/cPjrvJJaESY/toK7QxEgRn0J * Add 2 signals for controller commands : ZWaveNetwork.SIGNAL_CONTROLLER_COMMAND and ZWaveNetwork.SIGNAL_CONTROLLER_WAITING * Mark old methods and signals as deprecated. It is strongly recommended to use the new schema. @@ -23,10 +145,12 @@ python-openzwave 0.3.0-beta3: python-openzwave 0.3.0-beta2: + * Move to OpenZWave git organisation python-openzwave 0.3.0-beta1: + * Add pyozwman script : after installing you can launch it wit : Usage: ozwsh [--device=/dev/ttyUSB0] [--log=Debug] ... * Add pyozwweb confiuration file. * Add version management in Makefile. diff --git a/docs/DEVEL.rst b/docs/DEVEL.rst index d067a7e6..1e6a79f6 100644 --- a/docs/DEVEL.rst +++ b/docs/DEVEL.rst @@ -4,151 +4,65 @@ Developers information ====================== + How to develop for python-openzwave =================================== -Get the sources - -.. code-block:: bash - git clone https://github.com/OpenZWave/python-openzwave +Fork the project on Github. -You must now install python-openzwave in develop mode +Get the sources : .. code-block:: bash - make develop + git clone https://github.com/yourname/python-openzwave -Your password will be asked (by sudo) for installing eggs in your local directory. - -Develop, test, debug, test, ... :) - -Update the documentation if needed. You surely found the documentation useful, so please keep it up to date. - -You can create an account on travis or docker to run the tests. - -At last but not least, submit your request. - -How to develop for libopenzwave (was python-openzwave-lib) -========================================================== -After updating the pyx, you need to reinstall it. Otherwise, your changes will not be applied : +You can install all the dependances to develop for python-openzwave using the command : .. code-block:: bash - make develop - -Tests -===== -Travis-ci, Docker Hub, nosetests and pylint are used to test quality of code. There reports are here : + sudo make developer-deps - - Docker : https://registry.hub.docker.com/u/bibi21000/python-openzwave/ - - Travis : https://travis-ci.org/bibi21000/python-openzwave - - `Nosetests report `_ - - `Coverage report `_ - - `Pylint report `_ - -Some tests don't need a ZWave Stick to be launched, so they can be run on the autobuilders (travis, docker, ...). Place them in the autobuild directory. - -Some tests need manual operations (ie to add a node, to remove one, ...). For example, to test the remove node, use : +You must now install python-openzwave in develop mode. Depending on which python version you prefer, use : .. code-block:: bash - export MANUALSKIP='False' && /usr/local/bin/nosetests --verbosity=2 tests/api/test_controller_command.py -m test_150 && unset MANUALSKIP - test_150_command_remove_node_and_wait_for_user (tests.api.test_controller_command.TestControllerCommand) ... ok - - ---------------------------------------------------------------------- - Ran 1 test in 16.031s - - OK - -You should push the inclusion button of the node before the end of the test. - -Documentation -============= -Documentation is managed with sphinx. -Don't utpdate txt files (README, INSTALL, ...), update the RST sources in docs. -Use the following commands to generate all docs files (txt, html and joomla) - -You need to have installed python-openzave (in either develop or install mode) before generating the documentation. + make venv2-dev +or + .. code-block:: bash - make docs + make venv2-dev -Static vs dynamic (or shared) -============================= -The openzwave (c++) lib needs to run as a singleton : it means that it MUST have only one instance of the manager running on your computer. +Keep in mind that your updates must be python 2 / python 3 compatible. -There is 2 ways of linking libraries with a program : - - * static : includes a copy of the library in your binary program. - This means that your program has its own instance of the library. - This the way the install.sh runs. - So you CAN'T have another program (like the control-panel) running when using the python-openzwave library - - * dynamic or shared : includes a link to the library in your binary program. - This means that your program share the library with other programs. - In this case, the instance is owned directly by the library. - This the way the debian package works. So you CAN have another program running when using the python-openzwave library. - Of course, this program MUST use the shared library too. - -About sudo -========== -If you are like me and don't like root (and sudo), you can use the following tip to install packages via pip : - -Look at your python local library, it should looks like : - -.. code-block:: bash - - ls -lisa /usr/local/lib/python2.7/dist-packages/ - total 2428 - 1445174 12 drwxrwsr-x 115 root staff 12288 avril 9 21:35 . - 1445172 4 drwxrwsr-x 4 root staff 4096 mai 2 2014 .. - 1457164 4 drwxr-sr-x 5 root staff 4096 nov. 26 2013 actdiag - 1715480 4 drwxr-sr-x 2 root staff 4096 nov. 26 2013 actdiag-0.5.1.egg-info - 1457163 4 -rw-r--r-- 1 root staff 1004 nov. 26 2013 actdiag_sphinxhelper.py - 1457172 4 -rw-r--r-- 1 root staff 620 nov. 26 2013 actdiag_sphinxhelper.pyc - .... - -So, add your common user to the staff group : +Develop, test, debug, test, ... :) -.. code-block:: bash +Update the documentation if needed. You surely found the documentation useful, so please keep it up to date. - sudo usermod -a -G staff userName +It a good idea to add automatic tests. -Add the write right to the group staff +Launch the full test suite (for python 2 and python 3) : .. code-block:: bash - sudo chmod -Rf g+w /usr/local/lib/python2.7/dist-packages/ - -And now, it's time log off and log on. Groups are checked when you open the session. - -You can now install your packages without sudo. - -Python3 and virtualenv -====================== -Python 3 is actually not supported. + make venv-tests -A branch (python3) has been created with a special Dockerfile. It build python-openzwave and launch some tests. -This branch is automatically merged from master at "make commit". +At last but not least, submit your request with the result of tests in the comment. -So please, do not directly push under python3 branch. Make your developments under master or another branch. +If you don't follow the previous steps, your PR will be refused or letting in pending state until I've got time to test it. -It's important for me have python2/python3 compatibilty in the master branch. -cython can help for this : http://docs.cython.org/src/tutorial/strings.html -The Makefile sill try to automatically configure your version of python (running python --version). +Documentation +============= -If you want to install python-openzwave in a python virtual environnement, you should use something like : +First, install the dependances : .. code-block:: bash - make VIRTUAL_ENV=/path/to/my/venv ... - -If you use python 3 and your python executable is called python3 : + sudo make doc-deps -.. code-block:: bash +Documentation is managed with sphinx. - make PYTHON_EXEC=python3 ... +Don't update txt and rst files (README, INSTALL, ...) in the root directory, update the RST sources in docs. -You can also put these variables in a CONFIG.make file instead of passing them to the command line diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst new file mode 100755 index 00000000..890e529c --- /dev/null +++ b/docs/INSTALL.rst @@ -0,0 +1,41 @@ +:orphan: + +==================================== +Installing python-openzwave from pip +==================================== + + +Flavors +======= + +Flavor embed +------------ + + +Flavor shared +------------- + + +Flavor git +---------- + + +Flavor ozwdev +------------- + + +Flavor ozwdev +------------- + + +Flavor dev +---------- + + +OS +== + +Windows +------- + + diff --git a/docs/INSTALL_ARCH.rst b/docs/INSTALL_ARCH.rst index 5952128a..6a5ff8aa 100755 --- a/docs/INSTALL_ARCH.rst +++ b/docs/INSTALL_ARCH.rst @@ -4,9 +4,11 @@ Installing python-openzwave from archive ======================================== -This is the simplest (and the fastest) way to install python-openzwave. It cames with openzwave source files and is already cythonized. +This method is deprecated for 0.4.X. Use pip with --embed flavor. Look at README. -This is surely the best soltion to install python-openzwave on a raspberry pi. +This is the simplest (and the fastest) way to install python-openzwave. It comes with openzwave source files and is already cythonized. + +This is surely the best solution to install python-openzwave on a raspberry pi. Get archive of python-openzwave =============================== @@ -15,7 +17,7 @@ You are now ready to download sources of python-openzwave here : .. code-block:: bash - http://bibi21000.no-ip.biz/python-openzwave/ + https://github.com/OpenZWave/python-openzwave/tree/master/archives This archive contains sources of python-openzwave and openzwave. @@ -50,28 +52,27 @@ Now, you can compile sources : make build -If you have already built python-openzwave or the build failed -you can use the clean option : +If you have already built python-openzwave or if the build failed +you can use the clean target and build again : .. code-block:: bash sudo make clean make build -Do not use root to build python-openzwave as it will surely fails. Please use a "normal user". +Do not use root to build python-openzwave as root it will surely fails. Please use a "normal user". Installation ============ -You can now install the packages using the following command will. +You can now install the packages using the following command : .. code-block:: bash sudo make install -The installation script create a list of installed files. So you can remove -python-openzwave using the following command : +You can remove python-openzwave using : .. code-block:: bash diff --git a/docs/INSTALL_MAC.rst b/docs/INSTALL_MAC.rst index 9ded5e53..6369ee7f 100755 --- a/docs/INSTALL_MAC.rst +++ b/docs/INSTALL_MAC.rst @@ -4,6 +4,4 @@ Installing python-openzwave on MacOs ==================================== -To be done - -Looking for volunteers +Look at README for 0.4.X installation. diff --git a/docs/INSTALL_REPO.rst b/docs/INSTALL_REPO.rst index 00a6e611..14145af0 100755 --- a/docs/INSTALL_REPO.rst +++ b/docs/INSTALL_REPO.rst @@ -4,6 +4,8 @@ Installing python-openzwave from repository =========================================== +This method is deprecated for 0.4.X. Use pip with --git flavor. Look at README. + Install the needed tools ======================== @@ -30,6 +32,12 @@ computer in a directory called python-openzwave. Install dependencies ==================== +Go to the previously created directory + +.. code-block:: bash + + cd python-openzwave + You need some tools (a c++ compiler, headers dir python, ...) to build python-openzwave and openzwave library. On a debian like distribution : @@ -43,11 +51,6 @@ For non-debian (fedora, ...), you can retrieve the packages needed in the Makefi Update and build process ======================== -Go to the previously created directory - -.. code-block:: bash - - cd python-openzwave The following command will update your local repository to the last release of python-openzwave and openzwave. diff --git a/docs/INSTALL_WIN.rst b/docs/INSTALL_WIN.rst index 3c960e87..6ced83fc 100755 --- a/docs/INSTALL_WIN.rst +++ b/docs/INSTALL_WIN.rst @@ -4,6 +4,184 @@ Installing python-openzwave on Windows ====================================== -To be done -Looking for volunteers +Install Microsoft tools +======================= + +This package use MSBuild.exe to build openzwave code. + +You can find it in Visual Studio 2017 or Visual Studio 2015. + +It's also possible to get it as a separate package. + +Only release 14.0 and 15.0 of Microsft Build Tools are tested. + +You nust use the C++ compiler used to build your version of python : https://wiki.python.org/moin/WindowsCompilers + + +Install other tools +=================== + +You need git to clone the repository and python (32 bits or 64 bits). Add it to your PATH. + +Install dependencies : + + - for python 2.7 : + + .. code-block:: bash + + (venvX) pip install Cython six Louie + + - for python 3 : + + .. code-block:: bash + + (venvX) pip install Cython six PyDispatcher + +clone repositories +================== + +Clone python-openzwave: + + +.. code-block:: bash + + git clone https://github.com/OpenZWave/python-openzwave.git + +And clone open-zwave inside python-openzwave : + +.. code-block:: bash + + cd python-openzwave + git clone https://github.com/OpenZWave/open-zwave.git openzwave + +It's mandatory to clone the previous repository in a directory called openzwave (not open-zwave) + +Visual studio +============= + +Copy vs2010 in a new directory vs2017 (or vs2015 depending of which Visual Studio you use) : + +.. code-block:: bash + + xcopy openzwave\cpp\build\windows\vs2010 openzwave\cpp\build\windows\vs2017 /s /e /h + +Open the project (openzwave\cpp\build\windows\vs2017\OpenZWave.sln) in your Visual Studio. +If you want to build for 64bits, add a new target for it. And finally close it. + +Python-openzwave +================ + +Build and install python-openzwave : + + .. code-block:: bash + + python setup.py install --flavor=dev + + .. code-block:: bash + + sysargv ['setup.py', 'install'] + thon setup.py install --flavor=dev + Requirement already satisfied: Cython in c:\program files (x86)\python36-32\lib\site-packages + {'name': 'libopenzwave', 'sources': ['src-lib/libopenzwave/libopenzwave.pyx'], 'include_dirs': ['openzwave/cpp/src', 'openzwave + /cpp/src/value_classes', 'openzwave/cpp/src/platform', 'openzwave/cpp/build/windows', 'src-lib/libopenzwave', 'openzwave/cpp/bu + ild/windows/vs2017/Release/'], 'define_macros': [('PY_LIB_VERSION', '0.4.4'), ('PY_SSIZE_T_CLEAN', 1), ('PY_LIB_FLAVOR', 'dev') + , ('PY_LIB_BACKEND', 'cython')], 'libraries': ['setupapi', 'msvcrt', 'ws2_32', 'dnsapi'], 'extra_objects': ['openzwave/cpp/buil + d/windows/vs2017/Release//OpenZWave.lib'], 'extra_compile_args': [], 'extra_link_args': [], 'language': 'c++'} + ['six', 'PyDispatcher>=2.0.5', 'Cython'] + Requirement already satisfied: Cython in c:\program files (x86)\python36-32\lib\site-packages + running install + flavor --flavor=dev c:\program files (x86)\python36-32\lib\site-packages + running build_openzwave + Found MSBuild.exe : c:/Program Files (x86)/Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe + Found arch : Win32 wave + Found Visual Studio project : vs2017 (x86)/Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe + Found build path : openzwave/cpp/build/windows/vs2017/Release/ + ... + ... + byte-compiling C:\Program Files (x86)\Python36-32\Lib\site-packages\python_openzwave\scripts\__init__.py to __init__.cpython-36 + .pyc + running install_egg_info + running egg_info + writing python_openzwave.egg-info\PKG-INFO + writing dependency_links to python_openzwave.egg-info\dependency_links.txt + writing entry points to python_openzwave.egg-info\entry_points.txt + ================================================================ + .\scripts\allusers.bat + this script is executed for all users + delete/rename it if you dont need it + ================================================================ + Page de codes active�: 437 + +And finally, test it : + + .. code-block:: bash + + pyozw_check -l -d COM2 -t 30 + + .. code-block:: bash + + ------------------------------------------------------------------------------- + Define options for device COM2 + Start network + Wait for network awake (30s) + ------------------------------------------------------------------------------- + Network is awaked. Talk to controller. + Get python_openzwave version : 0.4.4 + Get python_openzwave config version : Original Z-Wave 2.78 + Get python_openzwave flavor : dev + Get openzwave version : 1.4.2942 + Get config path : C:\Program Files\Python36\lib\site-packages\python_openzwave\ozw_config + Controller capabilities : {'primaryController', 'staticUpdateController'} + Controller node capabilities : {'listening', 'primaryController', 'beaming', 'staticUpdateController'} + Nodes in network : 4 + ------------------------------------------------------------------------------- + Wait for network ready (30s) + ------------------------------------------------------------------------------- + Network is ready. Get nodes + ------------------------------------------------------------ + 1 - Name : ( Location : ) + 1 - Ready : True / Awake : True / Failed : False + 1 - Manufacturer : Aeotec ( id : 0x0086 ) + 1 - Product : DSA02203 Z-Stick S2 ( id : 0x0001 / type : 0x0002 / Version : 3) + 1 - Command classes : set() + 1 - Capabilities : {'listening', 'primaryController', 'beaming', 'staticUpdateController'} + 1 - Neighbors : {4} / Power level : None + 1 - Is sleeping : False / Can wake-up : False / Battery level : None + ------------------------------------------------------------ + 2 - Name : ( Location : ) + 2 - Ready : True / Awake : True / Failed : False + 2 - Manufacturer : ( id : 0x0000 ) + 2 - Product : ( id : 0x0000 / type : 0x0000 / Version : 2) + 2 - Command classes : set() + 2 - Capabilities : {'listening', 'routing'} + 2 - Neighbors : {3} / Power level : None + 2 - Is sleeping : False / Can wake-up : False / Battery level : None + ------------------------------------------------------------ + 3 - Name : ( Location : ) + 3 - Ready : False / Awake : True / Failed : True + 3 - Manufacturer : ( id : 0x0000 ) + 3 - Product : ( id : 0x0000 / type : 0x0000 / Version : 3) + 3 - Command classes : set() + 3 - Capabilities : {'listening', 'routing', 'beaming'} + 3 - Neighbors : set() / Power level : None + 3 - Is sleeping : False / Can wake-up : False / Battery level : None + ------------------------------------------------------------ + 4 - Name : ( Location : ) + 4 - Ready : True / Awake : True / Failed : False + 4 - Manufacturer : GreenWave ( id : 0x0099 ) + 4 - Product : PowerNode 6 port ( id : 0x0004 / type : 0x0003 / Version : 4) + 4 - Command classes : {'COMMAND_CLASS_MANUFACTURER_SPECIFIC', 'COMMAND_CLASS_ASSOCIATION', 'COMMAND_CLASS_NO_OPERATION', 'COMM + AND_CLASS_VERSION', 'COMMAND_CLASS_SWITCH_BINARY', 'COMMAND_CLASS_MULTI_INSTANCE/CHANNEL', 'COMMAND_CLASS_CRC_16_ENCAP', 'COMMA + ND_CLASS_PROTECTION', 'COMMAND_CLASS_CONFIGURATION', 'COMMAND_CLASS_BASIC', 'COMMAND_CLASS_METER', 'COMMAND_CLASS_SWITCH_ALL'} + 4 - Capabilities : {'listening', 'routing', 'beaming'} + 4 - Neighbors : {1} / Power level : None + 4 - Is sleeping : False / Can wake-up : False / Battery level : None + ------------------------------------------------------------ + Driver statistics : {'SOFCnt': 49, 'ACKWaiting': 0, 'readAborts': 0, 'badChecksum': 0, 'readCnt': 49, 'writeCnt': 46, 'CANCnt': + 0, 'NAKCnt': 1, 'ACKCnt': 30, 'OOFCnt': 0, 'dropped': 17, 'retries': 0, 'callbacks': 0, 'badroutes': 0, 'noack': 4, 'netbusy': + 0, 'nondelivery': 0, 'routedbusy': 0, 'broadcastReadCnt': 0, 'broadcastWriteCnt': 9} + ------------------------------------------------------------ + Stop network + Exit + diff --git a/docs/Makefile b/docs/Makefile index 6a2207bb..8b00b67f 100755 --- a/docs/Makefile +++ b/docs/Makefile @@ -43,7 +43,7 @@ clean: -rm -rf $(BUILDDIR)/* html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXBUILD) -E -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." diff --git a/docs/README.rst b/docs/README.rst index 4a79992b..c4ae7c44 100755 --- a/docs/README.rst +++ b/docs/README.rst @@ -1,3 +1,23 @@ +.. image:: https://travis-ci.org/OpenZWave/python-openzwave.svg?branch=master + :target: https://travis-ci.org/OpenZWave/python-openzwave + :alt: Travis status + +.. image:: https://circleci.com/gh/OpenZWave/python-openzwave.png?style=shield + :target: https://circleci.com/gh/OpenZWave/python-openzwave + :alt: Circle status + +.. image:: https://ci.appveyor.com/api/projects/status/2ogl8tx7o3pqphc9?svg=true + :target: https://ci.appveyor.com/project/bibi21000/python-openzwave + :alt: Appveyor status + +.. image:: https://img.shields.io/pypi/format/python_openzwave.svg + :target: https://pypi.python.org/pypi/python_openzwave + :alt: Pypi format + +.. image:: https://img.shields.io/badge/Documentation-ok-brightgreen.svg?style=flat + :target: http://openzwave.github.io/python-openzwave/index.html + :alt: Documentation + ================ python-openzwave ================ @@ -10,16 +30,215 @@ python-openzwave is a python wrapper for the openzwave c++ library : https://git * a full-event webapp example : flask + socket.io + jquery * a suite of tests * many examples - - -python-openzwave 0.3.0-b4 is out !!! -==================================== -Look at CHANGELOG to see new features and release notes. - -Look at INSTALL_REPO to test it now - -Look at INSTALL_ARCH to install from archive : no need to install cython anymore - + * `Full documentation `_ + +python-openzwave 0.4.x is here !!! +================================== + +- New installation process via pip + +- First, you need some build tools and libs. On ubuntu, you should use : + + .. code-block:: bash + + sudo apt-get install --force-yes -y make libudev-dev g++ libyaml-dev + +- Make your virtualenv and activate it : + + .. code-block:: bash + + virtualenv --python=python3 venv3 + source venv3/bin/activate + +- Install the default flavor : + + .. code-block:: bash + + (venvX) pip install python_openzwave + +- The previous command try to install python_openzwave with the flavor 'shared'. + If it can't find a precompiled library of openzwave, it will use the flavor 'embed' with sources downloaded from https://github.com/OpenZWave/python-openzwave/tree/master/archives. + You can change this using flavor option. + There is a bug in the package dependencies and flavors on some systems. You may need to install dependencies manualy : + + - on python 2.7 : + + .. code-block:: bash + + (venvX) pip install cython wheel six pyserial + (venvX) pip install 'Louie>=1.1' + + - on python 3 : + + .. code-block:: bash + + (venvX) pip install cython wheel six pyserial + (venvX) pip install 'PyDispatcher>=2.0.5' + +- Choose your flavor : + + - embed : the default one. Download sources from https://github.com/OpenZWave/python-openzwave/tree/master/archives and + build them. Python_openzwave is statically build using a cythonized version of libopenzwave. No need to install cython. + - shared : if you have install openzwave as module manually, you can link python_openzwave to it. + - git : download sources from openzwave github and link statically to it. + - embed_shared : download sources from https://github.com/OpenZWave/python-openzwave/tree/master/archives, build and install as module on the system. + Python_openzwave use it. Need root access to install openzwave libs. + - git_shared : download sources from openzwave github, build and install them as module on the system. + Python_openzwave use it. Need root access to install openzwave libs. + - ozwdev and ozwdev_shared : use the dev branch of openzwave on github. + - dev : for python_openzwave developers. Look for openzwave sources in a local folder specified by the LOCAL_OPENZWAVE environment variable (defaults to 'openzwave'). + +- Install it : + + .. code-block:: bash + + (venvX) pip install python_openzwave --no-deps --install-option="--flavor=git" + +- You can update to the last version of openzwave using the git flavor : + + .. code-block:: bash + + (venvX) pip uninstall -y python_openzwave + (venvX) pip install python_openzwave --no-cache-dir --no-deps --install-option="--flavor=git" + + +- At last, you can launch pyozw_check to test your installation : + + If no usb stick is connected to the machine, launch : + + .. code-block:: bash + + (venvX) pyozw_check + + If you've one, use it for advanced checks : + + .. code-block:: bash + + (venvX) pyozw_check -i -d /dev/ttyUSB0 + + .. code-block:: bash + + ------------------------------------------------------------------------------- + Import libs + Try to import libopenzwave + Try to import libopenzwave.PyLogLevels + Try to get options + Try to get manager + Try to get python_openzwave version + 0.4.0.27 + Try to get python_openzwave full version + python-openzwave version 0.4.0.27 (dev / Apr 18 2017 - 23:22:26) + Try to get openzwave version + 1.4.2501 + Try to get default config path + /etc/openzwave/ + Try to import openzwave (API) + ------------------------------------------------------------------------------- + Intialize device /dev/ttyUSB0 + Try to get options + Try to get manager + 2017-04-12 16:41:29.329 Always, OpenZwave Version 1.4.2497 Starting Up + Try to add watcher + ... + 2017-04-12 16:44:05.880 Always, *************************************************************************** + 2017-04-12 16:44:05.880 Always, ********************* Cumulative Network Statistics ********************* + 2017-04-12 16:44:05.880 Always, *** General + 2017-04-12 16:44:05.880 Always, Driver run time: . . . 0 days, 0 hours, 1 minutes + 2017-04-12 16:44:05.880 Always, Frames processed: . . . . . . . . . . . . . . . . . . . . 27 + 2017-04-12 16:44:05.880 Always, Total messages successfully received: . . . . . . . . . . 27 + 2017-04-12 16:44:05.880 Always, Total Messages successfully sent: . . . . . . . . . . . . 19 + 2017-04-12 16:44:05.880 Always, ACKs received from controller: . . . . . . . . . . . . . 19 + 2017-04-12 16:44:05.880 Always, *** Errors + 2017-04-12 16:44:05.880 Always, Unsolicited messages received while waiting for ACK: . . 0 + 2017-04-12 16:44:05.880 Always, Reads aborted due to timeouts: . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, Bad checksum errors: . . . . . . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, CANs received from controller: . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, NAKs received from controller: . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, Out of frame data flow errors: . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, Messages retransmitted: . . . . . . . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, Messages dropped and not delivered: . . . . . . . . . . . 0 + 2017-04-12 16:44:05.880 Always, *************************************************************************** + 2017-04-12 16:44:07.887 Info, mgr, Driver for controller /dev/ttyUSB0 removed + Try to remove watcher + Try to destroy manager + Try to destroy options + + You can list the nodes on your network using : + + .. code-block:: bash + + (venvX) pyozw_check -l -d /dev/ttyUSB0 -t 60 + + .. code-block:: bash + + ------------------------------------------------------------------------------- + Define options for device /dev/ttyUSB0 + Start network + Wait for network (30s) + Network is ready + ------------------------------------------------------------------------------- + Controller capabilities : {'primaryController', 'staticUpdateController'} + Controller node capabilities : {'listening', 'primaryController', 'staticUpdateController', 'beaming'} + Nodes in network : 4 + Driver statistics : {'noack': 6, 'routedbusy': 0, 'readCnt': 115, 'ACKWaiting': 0, 'badChecksum': 0, 'broadcastReadCnt': 0, 'NAKCnt': 0, 'broadcastWriteCnt': 9, 'dropped': 0, 'CANCnt': 0, 'callbacks': 0, 'OOFCnt': 0, 'readAborts': 0, 'badroutes': 0, 'SOFCnt': 115, 'netbusy': 0, 'writeCnt': 49, 'nondelivery': 0, 'ACKCnt': 49, 'retries': 0} + ------------------------------------------------------------ + 1 - Name : ( Location : ) + 1 - Ready : True / Awake : True / Failed : False + 1 - Manufacturer : Aeotec ( id : 0x0086 ) + 1 - Product : DSA02203 Z-Stick S2 ( id : 0x0001 / type : 0x0002 ) + 1 - Version : 3 / Secured : False / Zwave+ : False + 1 - Command classes : {'COMMAND_CLASS_NO_OPERATION', 'COMMAND_CLASS_BASIC'} + 1 - Capabilities : {'staticUpdateController', 'listening', 'primaryController', 'beaming'} + 1 - Neigbors : {4} / Power level : None + 1 - Is sleeping : False / Can wake-up : False / Battery level : None + + ... + + ------------------------------------------------------------ + 4 - Name : ( Location : ) + 4 - Ready : True / Awake : True / Failed : False + 4 - Manufacturer : GreenWave ( id : 0x0099 ) + 4 - Product : PowerNode 6 port ( id : 0x0004 / type : 0x0003 ) + 4 - Version : 4 / Secured : False / Zwave+ : False + 4 - Command classes : {'COMMAND_CLASS_BASIC', 'COMMAND_CLASS_CONFIGURATION', 'COMMAND_CLASS_SWITCH_BINARY', 'COMMAND_CLASS_VERSION', 'COMMAND_CLASS_CRC_16_ENCAP', 'COMMAND_CLASS_MANUFACTURER_SPECIFIC', 'COMMAND_CLASS_ASSOCIATION', 'COMMAND_CLASS_MULTI_INSTANCE/CHANNEL', 'COMMAND_CLASS_METER', 'COMMAND_CLASS_PROTECTION', 'COMMAND_CLASS_NO_OPERATION', 'COMMAND_CLASS_SWITCH_ALL'} + 4 - Capabilities : {'listening', 'routing', 'beaming'} + 4 - Neigbors : {1} / Power level : None + 4 - Is sleeping : False / Can wake-up : False / Battery level : None + + ... + + + - The old manager is now available via the pyozw_shell command. You need to install module "urwid>=1.1.1" with pip before using it. + + - libopenzwave and openzwave python modules are packaged in the python_openzwave. + So developers needs to update their install_requires (it works fine with pyozw_manager). + They can use the following code to update softly : + + .. code-block:: python + + pyozw_version='0.4.1' + + def install_requires(): + try: + import python_openzwave + return ['python_openzwave==%s' % pyozw_version] + except ImportError: + pass + try: + import libopenzwave + return ['openzwave==%s' % pyozw_version] + except ImportError: + pass + return ['python_openzwave == %s' % pyozw_version] + + + - If you already have an 0.3.x version installed, you should update your installation as usual. Don't install it with pip as it can break your installation (maybe not if you don't remove old modules) + + - Support for windows, macosx, ... is not tested. Feel free to report bug and patches. We can try to support these plateforms. Don't have Windows at home so I can't help. Same for mac. + + - Old installation process is deprecated and reserved for python-openzwave-developers and alternatives machines. + + - Please report your successful installations here : https://github.com/OpenZWave/python-openzwave/issues/73 Support ======= @@ -27,87 +246,7 @@ You can ask for support on the google group : http://groups.google.com/d/forum/p Please don't ask for support in github issues or by email. - Pull requests ============= Please read DEVEL documentation before submitting pull request. A lot of project tasks are done automatically or with makefile, so they must be done in a certain place or in a special order. - -Migrating from python-openzwave 0.2.X to 0.3.0 -============================================== -I need to update source tree of python-openzwave and modules's names because of a bug in setuptools : https://bitbucket.org/pypa/setuptools/issue/230/develop-mode-does-not-respect-src . -Sorry for that. - -Update your sources: - -.. code-block:: bash - - git pull - -Before building python-openzwave 0.3.0, you must uninstall the old version : - -.. code-block:: bash - - sudo make uninstall - -About cython : I've made many tests using cython installed via pip : (0.20, 0.21 and 0.22). -Compilation is ok but a segfault appears when launching the tests. Please remove it. - -.. code-block:: bash - - sudo pip uninstall Cython - -You also need to make some minor updates in you code, look at CHANGELOG - -If you have problems, please submit an issue with : - - - cython -V - - the content of the directory /usr/local/lib/python2.7/dist-packages/ (for python2.7) - - the content of /usr/local/lib/python2.7/dist-packages/easy-install.pth (for python 2.7) - - -Ubuntu 64bits ... and the others -================================ - -If you're using Ubuntu 64 bits (and mayde others) and keep your distribution up to date, -you certainly have the segfault problem : https://github.com/OpenZWave/python-openzwave/issues/121 - -It appears with the last update of python : - -.. code-block:: bash - - $ python - Python 2.7.6 (default, Jun 22 2015, 17:58:13) - [GCC 4.8.2] on linux2 - Type "help", "copyright", "credits" or "license" for more information. - - -I've open a discussion on cython-users here : https://groups.google.com/forum/#!topic/cython-users/mRsviGuCFOk - -The only way I found to avoid this is to rebuild and reinstall the old release of python : - -.. code-block:: bash - - wget https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6-8.dsc https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6.orig.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6-8.diff.gz - - dpkg-source -x python2.7_2.7.6-8.dsc - - sudo apt-get build-dep python2.7 - - cd python2.7-2.7.6 - - dpkg-buildpackage - -Wait, wait and await again :) - -.. code-block:: bash - - cd .. - - sudo dpkg -i *.deb - -To prevent future updates of python, you could mark its packages. For example, if you use apt to update your distribution, use the following command : - -.. code-block:: bash - - sudo apt-mark hold idle-python2.7 libpython2.7-minimal python2.7-dbg python2.7-minimal libpython2.7 libpython2.7-stdlib python2.7-dev libpython2.7-dbg libpython2.7-testsuite python2.7-doc libpython2.7-dev python2.7 python2.7-examples diff --git a/docs/_index_txt.rst b/docs/_index_txt.rst index 4ebd7801..c0e88762 100755 --- a/docs/_index_txt.rst +++ b/docs/_index_txt.rst @@ -5,7 +5,6 @@ * :doc:`Install from archive ` * :doc:`Install for MacOs ` * :doc:`Install for Windows ` -* :doc:`Manual installation ` * :doc:`Change log ` * :doc:`Examples ` * :doc:`Developpers notes ` diff --git a/docs/command.rst b/docs/command.rst index 0a0d4e9c..ecef5297 100755 --- a/docs/command.rst +++ b/docs/command.rst @@ -7,5 +7,5 @@ The commands to use with nodes. :maxdepth: 2 .. automodule:: openzwave.command - :members: ZWaveNodeBasic, ZWaveNodeSwitch, ZWaveNodeSensor + :members: ZWaveNodeBasic, ZWaveNodeSwitch, ZWaveNodeSensor, ZWaveNodeDoorLock diff --git a/docs/conf.py b/docs/conf.py index d1358e3e..5748fb51 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -257,3 +257,5 @@ # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' + +suppress_warnings = ['image.nonlocal_uri'] diff --git a/docs/data.rst b/docs/data.rst index 3787f3a9..fcf7357e 100755 --- a/docs/data.rst +++ b/docs/data.rst @@ -12,4 +12,8 @@ The common data structures and defitions. .. autodata:: PyValueTypes .. autodata:: PyLogLevels .. autodata:: PyControllerCommand +.. autodata:: PyControllerError .. autodata:: PyControllerState +.. autodata:: PyOptionList +.. autodata:: PyStatDriver +.. autodata:: PyStatNode diff --git a/docs/diagrams.rst b/docs/diagrams.rst index d3809f65..e470c482 100755 --- a/docs/diagrams.rst +++ b/docs/diagrams.rst @@ -8,7 +8,7 @@ Full startup process ==================== .. blockdiag:: - :maxwidth: 600 + :width: 600 blockdiag StartupProcess { orientation = portrait; diff --git a/docs/html/CHANGELOG.html b/docs/html/CHANGELOG.html deleted file mode 100644 index 9b99247f..00000000 --- a/docs/html/CHANGELOG.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - Changelog — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -
-

Changelog

-

Known bugs

-
-
    -
  • reloader problem : the network stop/start every time the app is realoaded. But in this case, the process terminates normally. -But there seems to be 2 running instances of the network.
  • -
-
-
-
python-openzwave 0.3.0-beta3:
-
    -
  • Add security rewrite support. See https://groups.google.com/forum/#!msg/openzwave/cPjrvJJaESY/toK7QxEgRn0J
  • -
  • Add 2 signals for controller commands : ZWaveNetwork.SIGNAL_CONTROLLER_COMMAND and ZWaveNetwork.SIGNAL_CONTROLLER_WAITING
  • -
  • Mark old methods and signals as deprecated. It is strongly recommended to use the new schema.
  • -
  • Add tests for controller commands.
  • -
  • Update isNodeAwake from function to property
  • -
  • Rename methods from node to be python compliant : is_awake, is_failed, is_ready, query_stage, is_info_received
  • -
  • Add facilities to run controller commands directly from node
  • -
  • Add request_state for node
  • -
  • Add new destroy method to network : use it to clean all openzwave c++ ressources
  • -
-
-
python-openzwave 0.3.0-beta2:
-
    -
  • Move to OpenZWave git organisation
  • -
-
-
python-openzwave 0.3.0-beta1:
-
    -
  • Add pyozwman script : after installing you can launch it wit : Usage: ozwsh [–device=/dev/ttyUSB0] [–log=Debug] ...
  • -
  • Add pyozwweb confiuration file.
  • -
  • Add version management in Makefile.
  • -
-
-
-

python-openzwave 0.3.0-alpha3:

-
-
    -
  • Fix bug in start/stop in network.
  • -
  • Fix bug in start/stop in pyozwweb app and tests.
  • -
  • Add map, scenes to PyOzwWeb
  • -
  • Add new tests
  • -
  • Fix some tests for controller commands
  • -
  • Finish the archive install : the lib is already cythonized. No need to install cython anymore.
  • -
  • Add a dockerfile
  • -
  • Add a branch for dockering with ptyhon 3
  • -
-
-

python-openzwave 0.3.0-alpha2:

-
-
    -
  • Fix bugs in lib
  • -
  • Fix bugs in API
  • -
  • Add kvals to API : allow user to store parameters with nodes, controllers, networks, ...
  • -
  • A a web demo : Flask + socket.io + jquery
  • -
  • Add logging facilities in the lib. Define different loggers for lib and api.
  • -
-
-

python-openzwave 0.3.0-alpha1:

-
-
    -
  • Update source tree to use setupttols develop mode : https://bitbucket.org/pypa/setuptools/issue/230/develop-mode-does-not-respect-src
  • -
  • Rewrite tests to use nosetest
  • -
  • Full implementation and tests of Options
  • -
  • PyLogLevels is now a dict of dicts to include doc : replace PyLogLevels[level] with PyLogLevels[level][‘value’] in your code
  • -
  • Remove old scripts. Replace them with a Makefile
  • -
  • Remove old unworking examples.
  • -
  • Add a constructor for PyOptions : def __init__(self, config_path=None, user_path=”.”, cmd_line=””). Please update your code.
  • -
-
-
- - -
-
-
-
-
-

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/COPYRIGHT.html b/docs/html/COPYRIGHT.html deleted file mode 100644 index 01b86e54..00000000 --- a/docs/html/COPYRIGHT.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - License — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -

This file is part of python-openzwave project https://github.com/OpenZWave/python-openzwave.

-
-

License

-

python-openzwave is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version.

-

python-openzwave is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details.

-

You should have received a copy of the GNU General Public License -along with python-openzwave. If not, see http://www.gnu.org/licenses.

-

author: bibi21000 <bibi21000@gmail.com> -author: maarten damen -license: GPL(v3)

-
- - -
-
-
-
-
-

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/DEVEL.html b/docs/html/DEVEL.html deleted file mode 100644 index 26fb3d83..00000000 --- a/docs/html/DEVEL.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - - - Developers information — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -
-

Developers information

-
-

How to develop for python-openzwave

-

Get the sources

-
git clone https://github.com/OpenZWave/python-openzwave
-
-
-

You must now install python-openzwave in develop mode

-
make develop
-
-
-

Your password will be asked (by sudo) for installing eggs in your local directory.

-

Develop, test, debug, test, ... :)

-

Update the documentation if needed. You surely found the documentation useful, so please keep it up to date.

-

You can create an account on travis or docker to run the tests.

-

At last but not least, submit your request.

-
-
-

How to develop for libopenzwave (was python-openzwave-lib)

-

After updating the pyx, you need to reinstall it. Otherwise, your changes will not be applied :

-
make develop
-
-
-
-
-

Tests

-

Travis-ci, Docker Hub, nosetests and pylint are used to test quality of code. There reports are here :

-
-
-

Some tests don’t need a ZWave Stick to be launched, so they can be run on the autobuilders (travis, docker, ...). Place them in the autobuild directory.

-

Some tests need manual operations (ie to add a node, to remove one, ...). For example, to test the remove node, use :

-
export MANUALSKIP='False' && /usr/local/bin/nosetests --verbosity=2 tests/api/test_controller_command.py -m test_150 && unset MANUALSKIP
-test_150_command_remove_node_and_wait_for_user (tests.api.test_controller_command.TestControllerCommand) ... ok
-
-----------------------------------------------------------------------
-Ran 1 test in 16.031s
-
-OK
-
-
-

You should push the inclusion button of the node before the end of the test.

-
-
-

Documentation

-

Documentation is managed with sphinx. -Don’t utpdate txt files (README, INSTALL, ...), update the RST sources in docs. -Use the following commands to generate all docs files (txt, html and joomla)

-

You need to have installed python-openzave (in either develop or install mode) before generating the documentation.

-
make docs
-
-
-
-
-

Static vs dynamic (or shared)

-

The openzwave (c++) lib needs to run as a singleton : it means that it MUST have only one instance of the manager running on your computer.

-

There is 2 ways of linking libraries with a program :

-
-
    -
  • static : includes a copy of the library in your binary program. -This means that your program has its own instance of the library. -This the way the install.sh runs. -So you CAN’T have another program (like the control-panel) running when using the python-openzwave library
  • -
  • dynamic or shared : includes a link to the library in your binary program. -This means that your program share the library with other programs. -In this case, the instance is owned directly by the library. -This the way the debian package works. So you CAN have another program running when using the python-openzwave library. -Of course, this program MUST use the shared library too.
  • -
-
-
-
-

About sudo

-

If you are like me and don’t like root (and sudo), you can use the following tip to install packages via pip :

-

Look at your python local library, it should looks like :

-
ls -lisa /usr/local/lib/python2.7/dist-packages/
-total 2428
-1445174  12 drwxrwsr-x 115 root staff  12288 avril  9 21:35 .
-1445172   4 drwxrwsr-x   4 root staff   4096 mai    2  2014 ..
-1457164   4 drwxr-sr-x   5 root staff   4096 nov.  26  2013 actdiag
-1715480   4 drwxr-sr-x   2 root staff   4096 nov.  26  2013 actdiag-0.5.1.egg-info
-1457163   4 -rw-r--r--   1 root staff   1004 nov.  26  2013 actdiag_sphinxhelper.py
-1457172   4 -rw-r--r--   1 root staff    620 nov.  26  2013 actdiag_sphinxhelper.pyc
-....
-
-
-

So, add your common user to the staff group :

-
sudo usermod -a -G staff userName
-
-
-

Add the write right to the group staff

-
sudo chmod -Rf g+w /usr/local/lib/python2.7/dist-packages/
-
-
-

And now, it’s time log off and log on. Groups are checked when you open the session.

-

You can now install your packages without sudo.

-
-
-

Python3 and virtualenv

-

Python 3 is actually not supported.

-

A branch (python3) has been created with a special Dockerfile. It build python-openzwave and launch some tests. -This branch is automatically merged from master at “make commit”.

-

So please, do not directly push under python3 branch. Make your developments under master or another branch.

-

It’s important for me have python2/python3 compatibilty in the master branch. -cython can help for this : http://docs.cython.org/src/tutorial/strings.html

-

The Makefile sill try to automatically configure your version of python (running python –version).

-

If you want to install python-openzwave in a python virtual environnement, you should use something like :

-
make VIRTUAL_ENV=/path/to/my/venv ...
-
-
-

If you use python 3 and your python executable is called python3 :

-
make PYTHON_EXEC=python3 ...
-
-
-

You can also put these variables in a CONFIG.make file instead of passing them to the command line

-
-
- - -
-
-
-
-
-

Table Of Contents

- - -

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/EXAMPLES.html b/docs/html/EXAMPLES.html deleted file mode 100644 index fe144c58..00000000 --- a/docs/html/EXAMPLES.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - python-openzwave — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -
-

python-openzwave

-

You need to install and build python-openzwave to test examples.

-
-

pyozwman

-

A shell manager for your ZWave network : PyOzwMan documentation

-
-
-

pyozwweb

-

A Flask + socket.io + jquery web application framework for your ZWave network : PyOzwWeb documentation

-
-
-

api_demo

-

A test demo for the api : it list all nodes/values on your network, trying -to identify your switches, dimmers and sensors.

-

Start it with :

-
./api_demo.py --device=/dev/yourzwavestick
-
-
-
-
-

test_lib

-

A test demo for the library : connect to the network and sniff for notifications.

-

Start it with :

-
./test_lib.py --device=/dev/yourzwavestick --sniff=30
-
-
-
-
-

api_snif

-

A test demo for the api : connect to the api and sniff for louie signal from it.

-

Start it with :

-
./api_sniff.py --device=/dev/yourzwavestick --sniff=30
-
-
-
-
-

memory_use

-

Try to evaluate the memory use of the api.

-

Start it with :

-
./memory_use.py --device=/dev/yourzwavestick
-
-
-
-
- - -
-
-
-
-
-

Table Of Contents

- - -

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/INSTALL_ARCH.html b/docs/html/INSTALL_ARCH.html deleted file mode 100644 index e9f9cc2e..00000000 --- a/docs/html/INSTALL_ARCH.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - Installing python-openzwave from archive — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -
-

Installing python-openzwave from archive

-

This is the simplest (and the fastest) way to install python-openzwave. It cames with openzwave source files and is already cythonized.

-

This is surely the best soltion to install python-openzwave on a raspberry pi.

-
-

Get archive of python-openzwave

-

You are now ready to download sources of python-openzwave here :

-
http://bibi21000.no-ip.biz/python-openzwave/
-
-
-

This archive contains sources of python-openzwave and openzwave.

-
tar xvzf python-openzwave-X.Y.Z.tar.gz
-
-
-

This command will extract all the needed sources. And change to the right directory.

-
cd python-openzwave-X.Y.Z
-
-
-
-
-

Install the needed tools

-

You must install git and other tools to get sources of python-openzwave and -openzwave and build them. Look at the documentation of your Linux distribution to do that.

-

On a debian like distribution :

-
sudo make deps
-
-
-
-
-

Build process

-

Now, you can compile sources :

-
make build
-
-
-

If you have already built python-openzwave or the build failed -you can use the clean option :

-
sudo make clean
-make build
-
-
-

Do not use root to build python-openzwave as it will surely fails. Please use a “normal user”.

-
-
-

Installation

-

You can now install the packages using the following command will.

-
sudo make install
-
-
-

The installation script create a list of installed files. So you can remove -python-openzwave using the following command :

-
sudo make uninstall
-
-
-
-
-

If it fails

-

Simply remove the python-openzwave-x.y.z directory and extract it again.

-
-
- - -
-
-
-
-
-

Table Of Contents

- - -

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/INSTALL_MAC.html b/docs/html/INSTALL_MAC.html deleted file mode 100644 index d2c6fc64..00000000 --- a/docs/html/INSTALL_MAC.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - Installing python-openzwave on MacOs — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -
-

Installing python-openzwave on MacOs

-

To be done

-

Looking for volunteers

-
- - -
-
-
-
-
-

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/INSTALL_REPO.html b/docs/html/INSTALL_REPO.html deleted file mode 100644 index 07f22196..00000000 --- a/docs/html/INSTALL_REPO.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - Installing python-openzwave from repository — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -
-

Installing python-openzwave from repository

-
-

Install the needed tools

-

You must install git and make to retrieve sources of python-openzwave and -openzwave.

-

On a debian like distribution :

-
sudo apt-get install -y git make
-
-
-
-
-

Get sources of python-openzwave

-

You are now ready to download sources of python-openzwave :

-
git clone https://github.com/OpenZWave/python-openzwave
-
-
-

The previous command will create a copy of the official repository on your -computer in a directory called python-openzwave.

-
-
-

Install dependencies

-

You need some tools (a c++ compiler, headers dir python, ...) to build python-openzwave and openzwave library.

-

On a debian like distribution :

-
sudo make repo-deps
-
-
-

For non-debian (fedora, ...), you can retrieve the packages needed in the Makefile.

-
-
-

Update and build process

-

Go to the previously created directory

-
cd python-openzwave
-
-
-

The following command will update your local repository to the last release -of python-openzwave and openzwave.

-
make update
-
-
-

When update process is done, you can compile sources

-
make build
-
-
-

Or if you have already build python-openzwave in a previous installation, you can use the clean target to remove old builds.

-
sudo make clean
-
-
-

Do not use root to build python-openzwave as it will surely fails. Please use a “normal user”.

-
-
-

Installation

-

You can now ready to install the eggs using the following command :

-
sudo make install
-
-
-

You can also remove python-openzwave using :

-
sudo make uninstall
-
-
-
-
-

Running tests

-

You can launch the regression tests using :

-
make tests
-
-
-

Keep in mind that the tests will “play” with your nodes : switching on and off, dimming, adding and removing scenes, ...

-
-
-

About the repositroy

-

This repository is a development tool, so it might be “unstable” ... yeah, sometimes it won’t build anymore :)

-

If you want to retrieve the last “good” commit, look at https://github.com/OpenZWave/python-openzwave/commits/master. -The commits names “Auto-commit for docs” are done after the full process : build + test + docs, so they might be “working” (almost for me).

-

You can also build a released version of python-openzwave using tags :

-
git tag
-
-v0.3.0-alpha2
-v0.3.0-alpha3
-v0.3.0-beta1
-v0.3.0-beta2
-v0.3.0a1
-
-
-
-
- - -
-
-
-
-
-

Table Of Contents

- - -

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/INSTALL_WIN.html b/docs/html/INSTALL_WIN.html deleted file mode 100644 index 4109871d..00000000 --- a/docs/html/INSTALL_WIN.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - Installing python-openzwave on Windows — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -
-

Installing python-openzwave on Windows

-

To be done

-

Looking for volunteers

-
- - -
-
-
-
-
-

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/README.html b/docs/html/README.html deleted file mode 100644 index a086f000..00000000 --- a/docs/html/README.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - python-openzwave — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
-
-
-
- -
-

python-openzwave

-

python-openzwave is a python wrapper for the openzwave c++ library : https://github.com/OpenZWave/open-zwave

-
-
    -
  • full manager implementation with options
  • -
  • an API to map the ZWave network in Python objects
  • -
  • a command line manager to manage / debug your ZWave network
  • -
  • a full-event webapp example : flask + socket.io + jquery
  • -
  • a suite of tests
  • -
  • many examples
  • -
-
-
-

python-openzwave 0.3.0-b4 is out !!!

-

Look at CHANGELOG to see new features and release notes.

-

Look at INSTALL_REPO to test it now

-

Look at INSTALL_ARCH to install from archive : no need to install cython anymore

-
-
-

Support

-

You can ask for support on the google group : http://groups.google.com/d/forum/python-openzwave-discuss.

-

Please don’t ask for support in github issues or by email.

-
-
-

Pull requests

-

Please read DEVEL documentation before submitting pull request. -A lot of project tasks are done automatically or with makefile, so they must be done in a certain place or in a special order.

-
-
-

Migrating from python-openzwave 0.2.X to 0.3.0

-

I need to update source tree of python-openzwave and modules’s names because of a bug in setuptools : https://bitbucket.org/pypa/setuptools/issue/230/develop-mode-does-not-respect-src . -Sorry for that.

-

Update your sources:

-
git pull
-
-
-

Before building python-openzwave 0.3.0, you must uninstall the old version :

-
sudo make uninstall
-
-
-

About cython : I’ve made many tests using cython installed via pip : (0.20, 0.21 and 0.22). -Compilation is ok but a segfault appears when launching the tests. Please remove it.

-
sudo pip uninstall Cython
-
-
-

You also need to make some minor updates in you code, look at CHANGELOG

-

If you have problems, please submit an issue with :

-
-
    -
  • cython -V
  • -
  • the content of the directory /usr/local/lib/python2.7/dist-packages/ (for python2.7)
  • -
  • the content of /usr/local/lib/python2.7/dist-packages/easy-install.pth (for python 2.7)
  • -
-
-
-
-

Ubuntu 64bits ... and the others

-

If you’re using Ubuntu 64 bits (and mayde others) and keep your distribution up to date, -you certainly have the segfault problem : https://github.com/OpenZWave/python-openzwave/issues/121

-

It appears with the last update of python :

-
$ python
-Python 2.7.6 (default, Jun 22 2015, 17:58:13)
-[GCC 4.8.2] on linux2
-Type "help", "copyright", "credits" or "license" for more information.
-
-
-

I’ve open a discussion on cython-users here : https://groups.google.com/forum/#!topic/cython-users/mRsviGuCFOk

-

The only way I found to avoid this is to rebuild and reinstall the old release of python :

-
wget https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6-8.dsc https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6.orig.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6-8.diff.gz
-
-dpkg-source -x python2.7_2.7.6-8.dsc
-
-sudo apt-get build-dep python2.7
-
-cd python2.7-2.7.6
-
-dpkg-buildpackage
-
-
-

Wait, wait and await again :)

-
cd ..
-
-sudo dpkg -i *.deb
-
-
-

To prevent future updates of python, you could mark its packages. For example, if you use apt to update your distribution, use the following command :

-
sudo apt-mark hold idle-python2.7 libpython2.7-minimal python2.7-dbg python2.7-minimal libpython2.7 libpython2.7-stdlib python2.7-dev libpython2.7-dbg  libpython2.7-testsuite python2.7-doc libpython2.7-dev python2.7 python2.7-examples
-
-
-
-
- - -
-
-
-
-
-

Table Of Contents

- - -

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/_images/blockdiag-b718f1ff7a0a1da53e9456b76ce5e452102efcee.png b/docs/html/_images/blockdiag-b718f1ff7a0a1da53e9456b76ce5e452102efcee.png deleted file mode 100644 index 8508f122..00000000 Binary files a/docs/html/_images/blockdiag-b718f1ff7a0a1da53e9456b76ce5e452102efcee.png and /dev/null differ diff --git a/docs/html/_images/blockdiag_thumb-ad738ccbf1111a92e761a710d8e22534a9076e97.png b/docs/html/_images/blockdiag_thumb-ad738ccbf1111a92e761a710d8e22534a9076e97.png deleted file mode 100644 index dfd8599d..00000000 Binary files a/docs/html/_images/blockdiag_thumb-ad738ccbf1111a92e761a710d8e22534a9076e97.png and /dev/null differ diff --git a/docs/html/_index_api.html b/docs/html/_index_api.html deleted file mode 100644 index ac7377a6..00000000 --- a/docs/html/_index_api.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - <no title> — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
- -
-
-

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/_index_lib.html b/docs/html/_index_lib.html deleted file mode 100644 index 2524488a..00000000 --- a/docs/html/_index_lib.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - <no title> — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
- -
-
-

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/_index_txt.html b/docs/html/_index_txt.html deleted file mode 100644 index a22bcbbd..00000000 --- a/docs/html/_index_txt.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - <no title> — python-openzwave 0.3.0b4 documentation - - - - - - - - - - - - - -
- -
-
-

This Page

- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/html/_sources/CHANGELOG.txt b/docs/html/_sources/CHANGELOG.txt deleted file mode 100644 index 6cadbd15..00000000 --- a/docs/html/_sources/CHANGELOG.txt +++ /dev/null @@ -1,64 +0,0 @@ -:orphan: - -========= -Changelog -========= - -Known bugs - - * reloader problem : the network stop/start every time the app is realoaded. But in this case, the process terminates normally. - But there seems to be 2 running instances of the network. - - -python-openzwave 0.3.0-beta3: - * Add security rewrite support. See https://groups.google.com/forum/#!msg/openzwave/cPjrvJJaESY/toK7QxEgRn0J - * Add 2 signals for controller commands : ZWaveNetwork.SIGNAL_CONTROLLER_COMMAND and ZWaveNetwork.SIGNAL_CONTROLLER_WAITING - * Mark old methods and signals as deprecated. It is strongly recommended to use the new schema. - * Add tests for controller commands. - * Update isNodeAwake from function to property - * Rename methods from node to be python compliant : is_awake, is_failed, is_ready, query_stage, is_info_received - * Add facilities to run controller commands directly from node - * Add request_state for node - * Add new destroy method to network : use it to clean all openzwave c++ ressources - - -python-openzwave 0.3.0-beta2: - * Move to OpenZWave git organisation - - -python-openzwave 0.3.0-beta1: - * Add pyozwman script : after installing you can launch it wit : Usage: ozwsh [--device=/dev/ttyUSB0] [--log=Debug] ... - * Add pyozwweb confiuration file. - * Add version management in Makefile. - - -python-openzwave 0.3.0-alpha3: - - * Fix bug in start/stop in network. - * Fix bug in start/stop in pyozwweb app and tests. - * Add map, scenes to PyOzwWeb - * Add new tests - * Fix some tests for controller commands - * Finish the archive install : the lib is already cythonized. No need to install cython anymore. - * Add a dockerfile - * Add a branch for dockering with ptyhon 3 - - -python-openzwave 0.3.0-alpha2: - - * Fix bugs in lib - * Fix bugs in API - * Add kvals to API : allow user to store parameters with nodes, controllers, networks, ... - * A a web demo : Flask + socket.io + jquery - * Add logging facilities in the lib. Define different loggers for lib and api. - - -python-openzwave 0.3.0-alpha1: - - * Update source tree to use setupttols develop mode : https://bitbucket.org/pypa/setuptools/issue/230/develop-mode-does-not-respect-src - * Rewrite tests to use nosetest - * Full implementation and tests of Options - * PyLogLevels is now a dict of dicts to include doc : replace PyLogLevels[level] with PyLogLevels[level]['value'] in your code - * Remove old scripts. Replace them with a Makefile - * Remove old unworking examples. - * Add a constructor for PyOptions : def __init__(self, config_path=None, user_path=".", cmd_line=""). Please update your code. diff --git a/docs/html/_sources/DEVEL.txt b/docs/html/_sources/DEVEL.txt deleted file mode 100644 index d067a7e6..00000000 --- a/docs/html/_sources/DEVEL.txt +++ /dev/null @@ -1,154 +0,0 @@ -:orphan: - -====================== -Developers information -====================== - -How to develop for python-openzwave -=================================== -Get the sources - -.. code-block:: bash - - git clone https://github.com/OpenZWave/python-openzwave - -You must now install python-openzwave in develop mode - -.. code-block:: bash - - make develop - -Your password will be asked (by sudo) for installing eggs in your local directory. - -Develop, test, debug, test, ... :) - -Update the documentation if needed. You surely found the documentation useful, so please keep it up to date. - -You can create an account on travis or docker to run the tests. - -At last but not least, submit your request. - -How to develop for libopenzwave (was python-openzwave-lib) -========================================================== -After updating the pyx, you need to reinstall it. Otherwise, your changes will not be applied : - -.. code-block:: bash - - make develop - -Tests -===== -Travis-ci, Docker Hub, nosetests and pylint are used to test quality of code. There reports are here : - - - Docker : https://registry.hub.docker.com/u/bibi21000/python-openzwave/ - - Travis : https://travis-ci.org/bibi21000/python-openzwave - - `Nosetests report `_ - - `Coverage report `_ - - `Pylint report `_ - -Some tests don't need a ZWave Stick to be launched, so they can be run on the autobuilders (travis, docker, ...). Place them in the autobuild directory. - -Some tests need manual operations (ie to add a node, to remove one, ...). For example, to test the remove node, use : - -.. code-block:: bash - - export MANUALSKIP='False' && /usr/local/bin/nosetests --verbosity=2 tests/api/test_controller_command.py -m test_150 && unset MANUALSKIP - test_150_command_remove_node_and_wait_for_user (tests.api.test_controller_command.TestControllerCommand) ... ok - - ---------------------------------------------------------------------- - Ran 1 test in 16.031s - - OK - -You should push the inclusion button of the node before the end of the test. - -Documentation -============= -Documentation is managed with sphinx. -Don't utpdate txt files (README, INSTALL, ...), update the RST sources in docs. -Use the following commands to generate all docs files (txt, html and joomla) - -You need to have installed python-openzave (in either develop or install mode) before generating the documentation. - -.. code-block:: bash - - make docs - -Static vs dynamic (or shared) -============================= -The openzwave (c++) lib needs to run as a singleton : it means that it MUST have only one instance of the manager running on your computer. - -There is 2 ways of linking libraries with a program : - - * static : includes a copy of the library in your binary program. - This means that your program has its own instance of the library. - This the way the install.sh runs. - So you CAN'T have another program (like the control-panel) running when using the python-openzwave library - - * dynamic or shared : includes a link to the library in your binary program. - This means that your program share the library with other programs. - In this case, the instance is owned directly by the library. - This the way the debian package works. So you CAN have another program running when using the python-openzwave library. - Of course, this program MUST use the shared library too. - -About sudo -========== -If you are like me and don't like root (and sudo), you can use the following tip to install packages via pip : - -Look at your python local library, it should looks like : - -.. code-block:: bash - - ls -lisa /usr/local/lib/python2.7/dist-packages/ - total 2428 - 1445174 12 drwxrwsr-x 115 root staff 12288 avril 9 21:35 . - 1445172 4 drwxrwsr-x 4 root staff 4096 mai 2 2014 .. - 1457164 4 drwxr-sr-x 5 root staff 4096 nov. 26 2013 actdiag - 1715480 4 drwxr-sr-x 2 root staff 4096 nov. 26 2013 actdiag-0.5.1.egg-info - 1457163 4 -rw-r--r-- 1 root staff 1004 nov. 26 2013 actdiag_sphinxhelper.py - 1457172 4 -rw-r--r-- 1 root staff 620 nov. 26 2013 actdiag_sphinxhelper.pyc - .... - -So, add your common user to the staff group : - -.. code-block:: bash - - sudo usermod -a -G staff userName - -Add the write right to the group staff - -.. code-block:: bash - - sudo chmod -Rf g+w /usr/local/lib/python2.7/dist-packages/ - -And now, it's time log off and log on. Groups are checked when you open the session. - -You can now install your packages without sudo. - -Python3 and virtualenv -====================== -Python 3 is actually not supported. - -A branch (python3) has been created with a special Dockerfile. It build python-openzwave and launch some tests. -This branch is automatically merged from master at "make commit". - -So please, do not directly push under python3 branch. Make your developments under master or another branch. - -It's important for me have python2/python3 compatibilty in the master branch. -cython can help for this : http://docs.cython.org/src/tutorial/strings.html - -The Makefile sill try to automatically configure your version of python (running python --version). - -If you want to install python-openzwave in a python virtual environnement, you should use something like : - -.. code-block:: bash - - make VIRTUAL_ENV=/path/to/my/venv ... - -If you use python 3 and your python executable is called python3 : - -.. code-block:: bash - - make PYTHON_EXEC=python3 ... - -You can also put these variables in a CONFIG.make file instead of passing them to the command line diff --git a/docs/html/_sources/EXAMPLES.txt b/docs/html/_sources/EXAMPLES.txt deleted file mode 100644 index 042887b4..00000000 --- a/docs/html/_sources/EXAMPLES.txt +++ /dev/null @@ -1,62 +0,0 @@ -:orphan: - -================ -python-openzwave -================ - -You need to install and build python-openzwave to test examples. - -pyozwman -======== - -A shell manager for your ZWave network : :doc:`PyOzwMan documentation ` - -pyozwweb -======== - -A Flask + socket.io + jquery web application framework for your ZWave network : :doc:`PyOzwWeb documentation ` - -api_demo -======== - -A test demo for the api : it list all nodes/values on your network, trying -to identify your switches, dimmers and sensors. - -Start it with : - -.. code-block:: bash - - ./api_demo.py --device=/dev/yourzwavestick - -test_lib -======== - -A test demo for the library : connect to the network and sniff for notifications. - -Start it with : - -.. code-block:: bash - - ./test_lib.py --device=/dev/yourzwavestick --sniff=30 - -api_snif -======== - -A test demo for the api : connect to the api and sniff for louie signal from it. - -Start it with : - -.. code-block:: bash - - ./api_sniff.py --device=/dev/yourzwavestick --sniff=30 - -memory_use -========== - -Try to evaluate the memory use of the api. - -Start it with : - -.. code-block:: bash - - ./memory_use.py --device=/dev/yourzwavestick diff --git a/docs/html/_sources/INSTALL_ARCH.txt b/docs/html/_sources/INSTALL_ARCH.txt deleted file mode 100644 index 5952128a..00000000 --- a/docs/html/_sources/INSTALL_ARCH.txt +++ /dev/null @@ -1,84 +0,0 @@ -:orphan: - -======================================== -Installing python-openzwave from archive -======================================== - -This is the simplest (and the fastest) way to install python-openzwave. It cames with openzwave source files and is already cythonized. - -This is surely the best soltion to install python-openzwave on a raspberry pi. - -Get archive of python-openzwave -=============================== - -You are now ready to download sources of python-openzwave here : - -.. code-block:: bash - - http://bibi21000.no-ip.biz/python-openzwave/ - -This archive contains sources of python-openzwave and openzwave. - -.. code-block:: bash - - tar xvzf python-openzwave-X.Y.Z.tar.gz - -This command will extract all the needed sources. And change to the right directory. - -.. code-block:: bash - - cd python-openzwave-X.Y.Z - -Install the needed tools -======================== - -You must install git and other tools to get sources of python-openzwave and -openzwave and build them. Look at the documentation of your Linux distribution to do that. - -On a debian like distribution : - -.. code-block:: bash - - sudo make deps - -Build process -============= - -Now, you can compile sources : - -.. code-block:: bash - - make build - -If you have already built python-openzwave or the build failed -you can use the clean option : - -.. code-block:: bash - - sudo make clean - make build - -Do not use root to build python-openzwave as it will surely fails. Please use a "normal user". - - -Installation -============ - -You can now install the packages using the following command will. - -.. code-block:: bash - - sudo make install - -The installation script create a list of installed files. So you can remove -python-openzwave using the following command : - -.. code-block:: bash - - sudo make uninstall - -If it fails -=========== - -Simply remove the python-openzwave-x.y.z directory and extract it again. - diff --git a/docs/html/_sources/INSTALL_REPO.txt b/docs/html/_sources/INSTALL_REPO.txt deleted file mode 100644 index 00a6e611..00000000 --- a/docs/html/_sources/INSTALL_REPO.txt +++ /dev/null @@ -1,118 +0,0 @@ -:orphan: - -=========================================== -Installing python-openzwave from repository -=========================================== - - -Install the needed tools -======================== -You must install git and make to retrieve sources of python-openzwave and -openzwave. - -On a debian like distribution : - -.. code-block:: bash - - sudo apt-get install -y git make - - -Get sources of python-openzwave -=============================== -You are now ready to download sources of python-openzwave : - -.. code-block:: bash - - git clone https://github.com/OpenZWave/python-openzwave - -The previous command will create a copy of the official repository on your -computer in a directory called python-openzwave. - -Install dependencies -==================== -You need some tools (a c++ compiler, headers dir python, ...) to build python-openzwave and openzwave library. - -On a debian like distribution : - -.. code-block:: bash - - sudo make repo-deps - -For non-debian (fedora, ...), you can retrieve the packages needed in the Makefile. - - -Update and build process -======================== -Go to the previously created directory - -.. code-block:: bash - - cd python-openzwave - -The following command will update your local repository to the last release -of python-openzwave and openzwave. - -.. code-block:: bash - - make update - -When update process is done, you can compile sources - -.. code-block:: bash - - make build - -Or if you have already build python-openzwave in a previous installation, you can use the clean target to remove old builds. - -.. code-block:: bash - - sudo make clean - -Do not use root to build python-openzwave as it will surely fails. Please use a "normal user". - - -Installation -============ -You can now ready to install the eggs using the following command : - -.. code-block:: bash - - sudo make install - -You can also remove python-openzwave using : - -.. code-block:: bash - - sudo make uninstall - - -Running tests -============= -You can launch the regression tests using : - -.. code-block:: bash - - make tests - -Keep in mind that the tests will "play" with your nodes : switching on and off, dimming, adding and removing scenes, ... - - -About the repositroy -==================== -This repository is a development tool, so it might be "unstable" ... yeah, sometimes it won't build anymore :) - -If you want to retrieve the last "good" commit, look at https://github.com/OpenZWave/python-openzwave/commits/master. -The commits names "Auto-commit for docs" are done after the full process : build + test + docs, so they might be "working" (almost for me). - -You can also build a released version of python-openzwave using tags : - -.. code-block:: bash - - git tag - - v0.3.0-alpha2 - v0.3.0-alpha3 - v0.3.0-beta1 - v0.3.0-beta2 - v0.3.0a1 - diff --git a/docs/html/_sources/INSTALL_WIN.txt b/docs/html/_sources/INSTALL_WIN.txt deleted file mode 100644 index 3c960e87..00000000 --- a/docs/html/_sources/INSTALL_WIN.txt +++ /dev/null @@ -1,9 +0,0 @@ -:orphan: - -====================================== -Installing python-openzwave on Windows -====================================== - -To be done - -Looking for volunteers diff --git a/docs/html/_sources/README.txt b/docs/html/_sources/README.txt deleted file mode 100644 index 4a79992b..00000000 --- a/docs/html/_sources/README.txt +++ /dev/null @@ -1,113 +0,0 @@ -================ -python-openzwave -================ - -python-openzwave is a python wrapper for the openzwave c++ library : https://github.com/OpenZWave/open-zwave - - * full manager implementation with options - * an API to map the ZWave network in Python objects - * a command line manager to manage / debug your ZWave network - * a full-event webapp example : flask + socket.io + jquery - * a suite of tests - * many examples - - -python-openzwave 0.3.0-b4 is out !!! -==================================== -Look at CHANGELOG to see new features and release notes. - -Look at INSTALL_REPO to test it now - -Look at INSTALL_ARCH to install from archive : no need to install cython anymore - - -Support -======= -You can ask for support on the google group : http://groups.google.com/d/forum/python-openzwave-discuss. - -Please don't ask for support in github issues or by email. - - -Pull requests -============= -Please read DEVEL documentation before submitting pull request. -A lot of project tasks are done automatically or with makefile, so they must be done in a certain place or in a special order. - -Migrating from python-openzwave 0.2.X to 0.3.0 -============================================== -I need to update source tree of python-openzwave and modules's names because of a bug in setuptools : https://bitbucket.org/pypa/setuptools/issue/230/develop-mode-does-not-respect-src . -Sorry for that. - -Update your sources: - -.. code-block:: bash - - git pull - -Before building python-openzwave 0.3.0, you must uninstall the old version : - -.. code-block:: bash - - sudo make uninstall - -About cython : I've made many tests using cython installed via pip : (0.20, 0.21 and 0.22). -Compilation is ok but a segfault appears when launching the tests. Please remove it. - -.. code-block:: bash - - sudo pip uninstall Cython - -You also need to make some minor updates in you code, look at CHANGELOG - -If you have problems, please submit an issue with : - - - cython -V - - the content of the directory /usr/local/lib/python2.7/dist-packages/ (for python2.7) - - the content of /usr/local/lib/python2.7/dist-packages/easy-install.pth (for python 2.7) - - -Ubuntu 64bits ... and the others -================================ - -If you're using Ubuntu 64 bits (and mayde others) and keep your distribution up to date, -you certainly have the segfault problem : https://github.com/OpenZWave/python-openzwave/issues/121 - -It appears with the last update of python : - -.. code-block:: bash - - $ python - Python 2.7.6 (default, Jun 22 2015, 17:58:13) - [GCC 4.8.2] on linux2 - Type "help", "copyright", "credits" or "license" for more information. - - -I've open a discussion on cython-users here : https://groups.google.com/forum/#!topic/cython-users/mRsviGuCFOk - -The only way I found to avoid this is to rebuild and reinstall the old release of python : - -.. code-block:: bash - - wget https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6-8.dsc https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6.orig.tar.gz https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.6-8.diff.gz - - dpkg-source -x python2.7_2.7.6-8.dsc - - sudo apt-get build-dep python2.7 - - cd python2.7-2.7.6 - - dpkg-buildpackage - -Wait, wait and await again :) - -.. code-block:: bash - - cd .. - - sudo dpkg -i *.deb - -To prevent future updates of python, you could mark its packages. For example, if you use apt to update your distribution, use the following command : - -.. code-block:: bash - - sudo apt-mark hold idle-python2.7 libpython2.7-minimal python2.7-dbg python2.7-minimal libpython2.7 libpython2.7-stdlib python2.7-dev libpython2.7-dbg libpython2.7-testsuite python2.7-doc libpython2.7-dev python2.7 python2.7-examples diff --git a/docs/html/_sources/_index_api.txt b/docs/html/_sources/_index_api.txt deleted file mode 100644 index 7f7ed932..00000000 --- a/docs/html/_sources/_index_api.txt +++ /dev/null @@ -1,18 +0,0 @@ -:orphan: - -* :doc:`Helloworld example ` -* :doc:`Network ` -* :doc:`Controller ` -* :doc:`Nodes ` -* :doc:`Commands ` -* :doc:`Groups and associations ` -* :doc:`Scenes ` -* :doc:`Values ` -* :doc:`Options for manager ` -* :doc:`Objects and Exceptions ` -* :doc:`Enums and data types ` -* :doc:`PyOzwWeb documentation ` -* :doc:`PyOzwMan documentation ` -* `Nose tests result `_ -* `Pylint report `_ -* `Coverage report `_ diff --git a/docs/html/_sources/_index_lib.txt b/docs/html/_sources/_index_lib.txt deleted file mode 100644 index 1c5b09a1..00000000 --- a/docs/html/_sources/_index_lib.txt +++ /dev/null @@ -1,7 +0,0 @@ -:orphan: - -* :doc:`Library ` -* :doc:`Enums and data types ` -* `Nose tests result `_ -* `Pylint report `_ -* `Coverage report `_ diff --git a/docs/html/_sources/_index_txt.txt b/docs/html/_sources/_index_txt.txt deleted file mode 100644 index 4ebd7801..00000000 --- a/docs/html/_sources/_index_txt.txt +++ /dev/null @@ -1,12 +0,0 @@ -:orphan: - -* :doc:`Readme ` -* :doc:`Install from repo ` -* :doc:`Install from archive ` -* :doc:`Install for MacOs ` -* :doc:`Install for Windows ` -* :doc:`Manual installation ` -* :doc:`Change log ` -* :doc:`Examples ` -* :doc:`Developpers notes ` -* :doc:`Copyrights ` diff --git a/docs/html/_sources/command.txt b/docs/html/_sources/command.txt deleted file mode 100644 index 0a0d4e9c..00000000 --- a/docs/html/_sources/command.txt +++ /dev/null @@ -1,11 +0,0 @@ -Command documentation -===================== - -The commands to use with nodes. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.command - :members: ZWaveNodeBasic, ZWaveNodeSwitch, ZWaveNodeSensor - diff --git a/docs/html/_sources/controller.txt b/docs/html/_sources/controller.txt deleted file mode 100644 index 21113d17..00000000 --- a/docs/html/_sources/controller.txt +++ /dev/null @@ -1,11 +0,0 @@ -Controller documentation -======================== - -The controller is the node of your adaptater. You can use it to retrieve -informations on it : library, statistics, ... - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.controller - :members: ZWaveController diff --git a/docs/html/_sources/data.txt b/docs/html/_sources/data.txt deleted file mode 100644 index 3787f3a9..00000000 --- a/docs/html/_sources/data.txt +++ /dev/null @@ -1,15 +0,0 @@ -Data documentation -=================== - -The common data structures and defitions. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: libopenzwave -.. autodata:: PyNotifications -.. autodata:: PyGenres -.. autodata:: PyValueTypes -.. autodata:: PyLogLevels -.. autodata:: PyControllerCommand -.. autodata:: PyControllerState diff --git a/docs/html/_sources/diagrams.txt b/docs/html/_sources/diagrams.txt deleted file mode 100644 index d3809f65..00000000 --- a/docs/html/_sources/diagrams.txt +++ /dev/null @@ -1,41 +0,0 @@ -:orphan: - -======================= -Notification's diagrams -======================= - -Full startup process -==================== - -.. blockdiag:: - :maxwidth: 600 - - blockdiag StartupProcess { - orientation = portrait; - - AddOtherNode [color = silver]; - AddSleepingNode [color = silver]; - - DriverReady -> AddControllerNode -> AddOtherNode; - AddOtherNode -> AddOtherNode [style = dashed]; - AddOtherNode -> ControllerEssentialNodeQueriesComplete -> ValueChanged; - ValueChanged -> ValueChanged [style = dashed]; - ValueChanged -> EssentialNodeQueriesComplete; - EssentialNodeQueriesComplete -> EssentialNodeQueriesComplete [style = dashed]; - - EssentialNodeQueriesComplete -> AwakeNodesQueried -> AddSleepingNode; - AddSleepingNode -> AddSleepingNode [style = dashed]; - AddSleepingNode -> SleepingValueChanged; - SleepingValueChanged -> SleepingValueChanged [style = dashed]; - SleepingValueChanged -> EssentialSleepingNodeQueriesComplete; - EssentialSleepingNodeQueriesComplete -> EssentialSleepingNodeQueriesComplete [style = dashed]; - EssentialSleepingNodeQueriesComplete -> AllNodesQueriedSomeDead; - - AddNodeProcess [color = silver]; - AddNodeProcess -> NodeAdded [style = none, color = none]; - NodeAdded -> NodeProtocolInfo -> EssentialNodeQueriesComplete -> ValueAdded_Basic; - ValueAdded_Basic -> ValueAdded_Basic [style = dashed]; - ValueAdded_Basic -> NodeNaming -> Group; - Group -> Group [style = dashed]; - Group -> Version; - } diff --git a/docs/html/_sources/group.txt b/docs/html/_sources/group.txt deleted file mode 100644 index 88cf6b2b..00000000 --- a/docs/html/_sources/group.txt +++ /dev/null @@ -1,11 +0,0 @@ -Group documentation -=================== - -The group is used in associations. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.group - :members: ZWaveGroup - diff --git a/docs/html/_sources/hello_world.txt b/docs/html/_sources/hello_world.txt deleted file mode 100644 index 168b115d..00000000 --- a/docs/html/_sources/hello_world.txt +++ /dev/null @@ -1,194 +0,0 @@ -:orphan: - -============================ -python-openzwave hello_world -============================ - -Here is the hello_world example for the python-openzwave API. In this -tutorial we will implement a simple sniffer. The full code is available -in the examples directory : hello_world.py. - -Some theory -=========== - -OpenZwave uses the mechanism of notifications to manage events network. -When the driver is ready, the node is added, a value is modified, ... openzwave -generates a notification you must catch with a callback function. - -Python-openzwave API catch the notification and send a louie signal. - -Some words about python-louie : it's a simple mechanism where a dispatcher -send a signal on a channel, and clients connect to him. - -Here is the way a sender dispatch a signal : - -.. code-block:: python - - dispatcher.send(self.SIGNAL_NODE, **{'network': self, 'node':self.nodes[args['nodeId']]}) - -Here is the way a client connect to a channel : - -.. code-block:: python - - dispatcher.connect(louie_node_update, ZWaveNetwork.SIGNAL_NODE) - -The first argument is a call back function : - -.. code-block:: python - - def louie_node_update(network, node): - print('Louie signal : Node update : %s.' % node) - -It receives as parameters the ones populate by the sender : the network ans a node in ths case. -The callback must set its parameter names as the same as the sender. - -Hello from ZWave -================ - -The import clauses : - -.. code-block:: python - - import openzwave - from openzwave.node import ZWaveNode - from openzwave.value import ZWaveValue - from openzwave.scene import ZWaveScene - from openzwave.controller import ZWaveController - from openzwave.network import ZWaveNetwork - from openzwave.option import ZWaveOption - import time - from louie import dispatcher, All - -First thing to do is to defined some options for the manager : - -.. code-block:: python - - options = ZWaveOption(device, config_path="../openzwave/config", user_path=".", cmd_line="") - options.set_log_file("OZW_Log.log") - options.set_append_log_file(False) - options.set_console_output(False) - options.set_save_log_level('Debug') - options.set_logging(True) - network = None - -We also defined a network object, we will populate it later. - -To use this options, you must lock them. No further modification could be done on them. - -.. code-block:: python - - options.lock() - -We can now create the network : - -.. code-block:: python - - network = ZWaveNetwork(options, autostart=False) - -The signals listeners -===================== - -We will now create some connection to the louie dispatcher. We will then to 3 -main signals, they will notify us about the state of the network : - -.. code-block:: python - - dispatcher.connect(louie_network_started, ZWaveNetwork.SIGNAL_NETWORK_STARTED) - dispatcher.connect(louie_network_failed, ZWaveNetwork.SIGNAL_NETWORK_FAILED) - dispatcher.connect(louie_network_ready, ZWaveNetwork.SIGNAL_NETWORK_READY) - -To do that we use 3 callback functions : - -When the driver is ready, we simply print some options on the screen : - -.. code-block:: python - - def louie_network_started(network): - print("Hello from network : I'm started : homeid %0.8x - %d nodes were found." % (network.home_id, network.nodes_count)) - -When the driver fails, we reports the error to screen : - -.. code-block:: python - - def louie_network_failed(network): - print("Hello from network : can't load :(.") - -This an important event. It means that all nodes have been queried on the network. -You can now use the network object pass in parameter to query nodes. To do that we connect -to some louie signals. It also sleep during 5 minutes. After that, the scripts -will continue and the network will be stopped. - -.. code-block:: python - - def louie_network_ready(network): - print("Hello from network : I'm ready : %d nodes were found." % network.nodes_count) - print("Hello from network : my controller is : %s" % network.controller) - dispatcher.connect(louie_node_update, ZWaveNetwork.SIGNAL_NODE) - dispatcher.connect(louie_value_update, ZWaveNetwork.SIGNAL_VALUE) - -When a node is updated, added, removed, ... - -.. code-block:: python - - def louie_node_update(network, node): - print('Hello from node : %s.' % node) - -When a value is updated, added, removed, ... - -.. code-block:: python - - def louie_value_update(network, node, value): - print('Hello from value : %s.' % value) - -The start code -============== - -We start the network - -.. code-block:: python - - network.start() - -And we wait for the network. You MUST NOT use the network objects before -network is ready. - -.. code-block:: python - - for i in range(0,90): - if network.state>=network.STATE_READY: - print "***** Network is ready" - break - else: - sys.stdout.write(".") - sys.stdout.flush() - time.sleep(1.0) - -We now change the name of the controller. You will have a notification. - -.. code-block:: python - - network.controller.node.name = "Hello name" - time.sleep(10.0) - -Same when changing the location. - -.. code-block:: python - - network.controller.node.location = "Hello location" - time.sleep(120.0) - -And we wait for 2 minutes. If you have sensors on your network, you will -see the value notifications on the screen. If you have switch or dimmers, -activate them manually, ... - -Now stop the network and release objects. - -.. code-block:: python - - network.stop() - -That's all :) - -Full source code is in examples/hello_world.py - -To see a more functionnal example, look at ozwsh code. diff --git a/docs/html/_sources/index.txt b/docs/html/_sources/index.txt deleted file mode 100644 index 6d61c312..00000000 --- a/docs/html/_sources/index.txt +++ /dev/null @@ -1,18 +0,0 @@ -Welcome to python-openzwave's documentation! -============================================ - -Contents: - -.. toctree:: - :maxdepth: 3 - - The new "pyx". It provides a low level to the ZWave network. - And its data's definitions - The new API. Map a ZWave Network in objects. - - -Indices and tables -================== - -* :ref:`genindex` - diff --git a/docs/html/_sources/libopenzwave.txt b/docs/html/_sources/libopenzwave.txt deleted file mode 100644 index 7da30fbe..00000000 --- a/docs/html/_sources/libopenzwave.txt +++ /dev/null @@ -1,7 +0,0 @@ -libopenzwave module -=================== - -.. automodule:: libopenzwave - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/html/_sources/network.txt b/docs/html/_sources/network.txt deleted file mode 100644 index 915997b1..00000000 --- a/docs/html/_sources/network.txt +++ /dev/null @@ -1,10 +0,0 @@ -Network documentation -===================== - -This is the central point. Everything is attached to a network. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.network - :members: ZWaveNetwork diff --git a/docs/html/_sources/node.txt b/docs/html/_sources/node.txt deleted file mode 100644 index 0dac00f2..00000000 --- a/docs/html/_sources/node.txt +++ /dev/null @@ -1,11 +0,0 @@ -Node documentation -================== - -The node. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.node - :members: ZWaveNode - diff --git a/docs/html/_sources/object.txt b/docs/html/_sources/object.txt deleted file mode 100644 index 93e1e972..00000000 --- a/docs/html/_sources/object.txt +++ /dev/null @@ -1,11 +0,0 @@ -Object documentation -==================== - -The low level object. Implements cache mechanism. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.object - :members: ZWaveObject, ZWaveNodeInterface, ZWaveException, ZWaveTypeException, - ZWaveCacheException, ZWaveCommandClassException, NullLoggingHandler diff --git a/docs/html/_sources/openzwave.txt b/docs/html/_sources/openzwave.txt deleted file mode 100644 index 20c1ee25..00000000 --- a/docs/html/_sources/openzwave.txt +++ /dev/null @@ -1,19 +0,0 @@ -API documentation -================= - -Contents: - -.. toctree:: - :maxdepth: 2 - - network - controller - option ` -* :doc:`PyOzwWeb documentation ` -* :doc:`PyOzwMan documentation ` -* `Nose tests result `_ -* `Pylint report `_ -* `Coverage report `_ diff --git a/docs/joomla/_sources/_index_lib.txt b/docs/joomla/_sources/_index_lib.txt deleted file mode 100644 index 1c5b09a1..00000000 --- a/docs/joomla/_sources/_index_lib.txt +++ /dev/null @@ -1,7 +0,0 @@ -:orphan: - -* :doc:`Library ` -* :doc:`Enums and data types ` -* `Nose tests result `_ -* `Pylint report `_ -* `Coverage report `_ diff --git a/docs/joomla/_sources/_index_txt.txt b/docs/joomla/_sources/_index_txt.txt deleted file mode 100644 index 4ebd7801..00000000 --- a/docs/joomla/_sources/_index_txt.txt +++ /dev/null @@ -1,12 +0,0 @@ -:orphan: - -* :doc:`Readme ` -* :doc:`Install from repo ` -* :doc:`Install from archive ` -* :doc:`Install for MacOs ` -* :doc:`Install for Windows ` -* :doc:`Manual installation ` -* :doc:`Change log ` -* :doc:`Examples ` -* :doc:`Developpers notes ` -* :doc:`Copyrights ` diff --git a/docs/joomla/_sources/command.txt b/docs/joomla/_sources/command.txt deleted file mode 100644 index 0a0d4e9c..00000000 --- a/docs/joomla/_sources/command.txt +++ /dev/null @@ -1,11 +0,0 @@ -Command documentation -===================== - -The commands to use with nodes. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.command - :members: ZWaveNodeBasic, ZWaveNodeSwitch, ZWaveNodeSensor - diff --git a/docs/joomla/_sources/controller.txt b/docs/joomla/_sources/controller.txt deleted file mode 100644 index 21113d17..00000000 --- a/docs/joomla/_sources/controller.txt +++ /dev/null @@ -1,11 +0,0 @@ -Controller documentation -======================== - -The controller is the node of your adaptater. You can use it to retrieve -informations on it : library, statistics, ... - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.controller - :members: ZWaveController diff --git a/docs/joomla/_sources/data.txt b/docs/joomla/_sources/data.txt deleted file mode 100644 index 3787f3a9..00000000 --- a/docs/joomla/_sources/data.txt +++ /dev/null @@ -1,15 +0,0 @@ -Data documentation -=================== - -The common data structures and defitions. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: libopenzwave -.. autodata:: PyNotifications -.. autodata:: PyGenres -.. autodata:: PyValueTypes -.. autodata:: PyLogLevels -.. autodata:: PyControllerCommand -.. autodata:: PyControllerState diff --git a/docs/joomla/_sources/diagrams.txt b/docs/joomla/_sources/diagrams.txt deleted file mode 100644 index d3809f65..00000000 --- a/docs/joomla/_sources/diagrams.txt +++ /dev/null @@ -1,41 +0,0 @@ -:orphan: - -======================= -Notification's diagrams -======================= - -Full startup process -==================== - -.. blockdiag:: - :maxwidth: 600 - - blockdiag StartupProcess { - orientation = portrait; - - AddOtherNode [color = silver]; - AddSleepingNode [color = silver]; - - DriverReady -> AddControllerNode -> AddOtherNode; - AddOtherNode -> AddOtherNode [style = dashed]; - AddOtherNode -> ControllerEssentialNodeQueriesComplete -> ValueChanged; - ValueChanged -> ValueChanged [style = dashed]; - ValueChanged -> EssentialNodeQueriesComplete; - EssentialNodeQueriesComplete -> EssentialNodeQueriesComplete [style = dashed]; - - EssentialNodeQueriesComplete -> AwakeNodesQueried -> AddSleepingNode; - AddSleepingNode -> AddSleepingNode [style = dashed]; - AddSleepingNode -> SleepingValueChanged; - SleepingValueChanged -> SleepingValueChanged [style = dashed]; - SleepingValueChanged -> EssentialSleepingNodeQueriesComplete; - EssentialSleepingNodeQueriesComplete -> EssentialSleepingNodeQueriesComplete [style = dashed]; - EssentialSleepingNodeQueriesComplete -> AllNodesQueriedSomeDead; - - AddNodeProcess [color = silver]; - AddNodeProcess -> NodeAdded [style = none, color = none]; - NodeAdded -> NodeProtocolInfo -> EssentialNodeQueriesComplete -> ValueAdded_Basic; - ValueAdded_Basic -> ValueAdded_Basic [style = dashed]; - ValueAdded_Basic -> NodeNaming -> Group; - Group -> Group [style = dashed]; - Group -> Version; - } diff --git a/docs/joomla/_sources/group.txt b/docs/joomla/_sources/group.txt deleted file mode 100644 index 88cf6b2b..00000000 --- a/docs/joomla/_sources/group.txt +++ /dev/null @@ -1,11 +0,0 @@ -Group documentation -=================== - -The group is used in associations. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.group - :members: ZWaveGroup - diff --git a/docs/joomla/_sources/hello_world.txt b/docs/joomla/_sources/hello_world.txt deleted file mode 100644 index 168b115d..00000000 --- a/docs/joomla/_sources/hello_world.txt +++ /dev/null @@ -1,194 +0,0 @@ -:orphan: - -============================ -python-openzwave hello_world -============================ - -Here is the hello_world example for the python-openzwave API. In this -tutorial we will implement a simple sniffer. The full code is available -in the examples directory : hello_world.py. - -Some theory -=========== - -OpenZwave uses the mechanism of notifications to manage events network. -When the driver is ready, the node is added, a value is modified, ... openzwave -generates a notification you must catch with a callback function. - -Python-openzwave API catch the notification and send a louie signal. - -Some words about python-louie : it's a simple mechanism where a dispatcher -send a signal on a channel, and clients connect to him. - -Here is the way a sender dispatch a signal : - -.. code-block:: python - - dispatcher.send(self.SIGNAL_NODE, **{'network': self, 'node':self.nodes[args['nodeId']]}) - -Here is the way a client connect to a channel : - -.. code-block:: python - - dispatcher.connect(louie_node_update, ZWaveNetwork.SIGNAL_NODE) - -The first argument is a call back function : - -.. code-block:: python - - def louie_node_update(network, node): - print('Louie signal : Node update : %s.' % node) - -It receives as parameters the ones populate by the sender : the network ans a node in ths case. -The callback must set its parameter names as the same as the sender. - -Hello from ZWave -================ - -The import clauses : - -.. code-block:: python - - import openzwave - from openzwave.node import ZWaveNode - from openzwave.value import ZWaveValue - from openzwave.scene import ZWaveScene - from openzwave.controller import ZWaveController - from openzwave.network import ZWaveNetwork - from openzwave.option import ZWaveOption - import time - from louie import dispatcher, All - -First thing to do is to defined some options for the manager : - -.. code-block:: python - - options = ZWaveOption(device, config_path="../openzwave/config", user_path=".", cmd_line="") - options.set_log_file("OZW_Log.log") - options.set_append_log_file(False) - options.set_console_output(False) - options.set_save_log_level('Debug') - options.set_logging(True) - network = None - -We also defined a network object, we will populate it later. - -To use this options, you must lock them. No further modification could be done on them. - -.. code-block:: python - - options.lock() - -We can now create the network : - -.. code-block:: python - - network = ZWaveNetwork(options, autostart=False) - -The signals listeners -===================== - -We will now create some connection to the louie dispatcher. We will then to 3 -main signals, they will notify us about the state of the network : - -.. code-block:: python - - dispatcher.connect(louie_network_started, ZWaveNetwork.SIGNAL_NETWORK_STARTED) - dispatcher.connect(louie_network_failed, ZWaveNetwork.SIGNAL_NETWORK_FAILED) - dispatcher.connect(louie_network_ready, ZWaveNetwork.SIGNAL_NETWORK_READY) - -To do that we use 3 callback functions : - -When the driver is ready, we simply print some options on the screen : - -.. code-block:: python - - def louie_network_started(network): - print("Hello from network : I'm started : homeid %0.8x - %d nodes were found." % (network.home_id, network.nodes_count)) - -When the driver fails, we reports the error to screen : - -.. code-block:: python - - def louie_network_failed(network): - print("Hello from network : can't load :(.") - -This an important event. It means that all nodes have been queried on the network. -You can now use the network object pass in parameter to query nodes. To do that we connect -to some louie signals. It also sleep during 5 minutes. After that, the scripts -will continue and the network will be stopped. - -.. code-block:: python - - def louie_network_ready(network): - print("Hello from network : I'm ready : %d nodes were found." % network.nodes_count) - print("Hello from network : my controller is : %s" % network.controller) - dispatcher.connect(louie_node_update, ZWaveNetwork.SIGNAL_NODE) - dispatcher.connect(louie_value_update, ZWaveNetwork.SIGNAL_VALUE) - -When a node is updated, added, removed, ... - -.. code-block:: python - - def louie_node_update(network, node): - print('Hello from node : %s.' % node) - -When a value is updated, added, removed, ... - -.. code-block:: python - - def louie_value_update(network, node, value): - print('Hello from value : %s.' % value) - -The start code -============== - -We start the network - -.. code-block:: python - - network.start() - -And we wait for the network. You MUST NOT use the network objects before -network is ready. - -.. code-block:: python - - for i in range(0,90): - if network.state>=network.STATE_READY: - print "***** Network is ready" - break - else: - sys.stdout.write(".") - sys.stdout.flush() - time.sleep(1.0) - -We now change the name of the controller. You will have a notification. - -.. code-block:: python - - network.controller.node.name = "Hello name" - time.sleep(10.0) - -Same when changing the location. - -.. code-block:: python - - network.controller.node.location = "Hello location" - time.sleep(120.0) - -And we wait for 2 minutes. If you have sensors on your network, you will -see the value notifications on the screen. If you have switch or dimmers, -activate them manually, ... - -Now stop the network and release objects. - -.. code-block:: python - - network.stop() - -That's all :) - -Full source code is in examples/hello_world.py - -To see a more functionnal example, look at ozwsh code. diff --git a/docs/joomla/_sources/index.txt b/docs/joomla/_sources/index.txt deleted file mode 100644 index 6d61c312..00000000 --- a/docs/joomla/_sources/index.txt +++ /dev/null @@ -1,18 +0,0 @@ -Welcome to python-openzwave's documentation! -============================================ - -Contents: - -.. toctree:: - :maxdepth: 3 - - The new "pyx". It provides a low level to the ZWave network. - And its data's definitions - The new API. Map a ZWave Network in objects. - - -Indices and tables -================== - -* :ref:`genindex` - diff --git a/docs/joomla/_sources/libopenzwave.txt b/docs/joomla/_sources/libopenzwave.txt deleted file mode 100644 index 7da30fbe..00000000 --- a/docs/joomla/_sources/libopenzwave.txt +++ /dev/null @@ -1,7 +0,0 @@ -libopenzwave module -=================== - -.. automodule:: libopenzwave - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/joomla/_sources/network.txt b/docs/joomla/_sources/network.txt deleted file mode 100644 index 915997b1..00000000 --- a/docs/joomla/_sources/network.txt +++ /dev/null @@ -1,10 +0,0 @@ -Network documentation -===================== - -This is the central point. Everything is attached to a network. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.network - :members: ZWaveNetwork diff --git a/docs/joomla/_sources/node.txt b/docs/joomla/_sources/node.txt deleted file mode 100644 index 0dac00f2..00000000 --- a/docs/joomla/_sources/node.txt +++ /dev/null @@ -1,11 +0,0 @@ -Node documentation -================== - -The node. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.node - :members: ZWaveNode - diff --git a/docs/joomla/_sources/object.txt b/docs/joomla/_sources/object.txt deleted file mode 100644 index 93e1e972..00000000 --- a/docs/joomla/_sources/object.txt +++ /dev/null @@ -1,11 +0,0 @@ -Object documentation -==================== - -The low level object. Implements cache mechanism. - -.. toctree:: - :maxdepth: 2 - -.. automodule:: openzwave.object - :members: ZWaveObject, ZWaveNodeInterface, ZWaveException, ZWaveTypeException, - ZWaveCacheException, ZWaveCommandClassException, NullLoggingHandler diff --git a/docs/joomla/_sources/openzwave.txt b/docs/joomla/_sources/openzwave.txt deleted file mode 100644 index 20c1ee25..00000000 --- a/docs/joomla/_sources/openzwave.txt +++ /dev/null @@ -1,19 +0,0 @@ -API documentation -================= - -Contents: - -.. toctree:: - :maxdepth: 2 - - network - controller - option