Permalink
Browse files

Removed open-zwave fork, fixed addvalueid segfault when value is a list.

Reverted neighbour change by popular demand :-)
  • Loading branch information...
maartendamen committed Sep 28, 2011
1 parent 42ac6a9 commit 00f6e13ef54563ab816d0af386ec4bdb48721006
Showing 409 changed files with 56 additions and 62,991 deletions.
View
40 README
@@ -1,40 +0,0 @@
-This is the readme file for the py-openzwave project.
-
----------------
-Building on Ubuntu 10.10 - (drewp@bigasterisk.com)
-
-The 'cython' version for Ubuntu 10.10 is 0.12.1, which is too
-old. You'll get an error at 'cdef extern from # "<string>"'. Removing
-that cython and running 'easy_install cython' will get you a version
-at least as new as 0.14.1, which will work.
-
-First build the openzwave library:
-(cd openzwave/cpp/build/linux; make)
-
-Then the python library:
-python setup.py build
-
-Then try running python (or ipython) and pasting the contents of
-test.py. You need to leave python running after the statements are
-done so callbacks can come in.
-
-For the tricklestar USB device, a more robust device name to use is
-/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0
-(as opposed to ttyUSB0/ttyUSB1/etc).
-
-I (drewp) still don't know the workflow for adding new devices. For
-that I used https://code.google.com/p/openzwave-control-panel/ which
-does have an 'add device' operation.
-
-----------------------------
-Adding devices
-
-from the ozcp code,
-
- setAdminFunction("Add Device");
- setAdminState(
- Manager::Get()->BeginControllerCommand(homeId,
- Driver::ControllerCommand_AddDevice,
- web_controller_update, this, true));
-then it waits for
- case Driver::ControllerState_Completed:
View
@@ -0,0 +1,47 @@
+py-openzwave
+============
+
+What is py-openzwave?
+---------------------
+py-openzwave is a python wrapper around the open-zwave c++ project.
+This allows you to interact with z-wave networks from withing Python.
+
+Build instructions for Windows
+------------------------------
+In order to build py-openzwave on Windows you need MinGW, MinGW is a minimalist GNU compiler for Windows.
+You can download MinGW here: http://www.mingw.org/
+Other requirements are:
+- Cython 14.1 or higher, available from: http://www.cython.org
+- Open-zwave revision r321 or higher (r321 contains patches for MinGW)
+
+We will assume the following build structure (different structure requires changes in py-openzwave's setup.py!):
+
+\ Root folder
+-\ py-openzwave source folder
+-\ open-zwave source folder
+
+1) From the root folder, type "cd open-zwave\cpp\build\windows\mingw32"
+2) Enter "make", this will build open-zwave. If all went will you should have an "openzwave.a" file in the "open-zwave\cpp\lib\windows-mingw32" directory.
+3) From the root folder, type "cd py-openzwave"
+4) Type "python setup.py build --compiler=mingw32", this should build the py-openzwave module. If you are satisfied with the build, you can install it by running "python setup.py install"
+
+Building on Ubuntu 10.10 (thanks Drew)
+--------------------------------------
+The 'cython' version for Ubuntu 10.10 is 0.12.1, which is too
+old. You'll get an error at 'cdef extern from # "<string>"'. Removing
+that cython and running 'easy_install cython' will get you a version
+at least as new as 0.14.1, which will work.
+
+First build the openzwave library:
+(cd openzwave/cpp/build/linux; make)
+
+Then the python library:
+python setup.py build
+
+Then try running python (or ipython) and pasting the contents of
+test.py. You need to leave python running after the statements are
+done so callbacks can come in.
+
+For the tricklestar USB device, a more robust device name to use is
+/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0
+(as opposed to ttyUSB0/ttyUSB1/etc).
@@ -380,11 +380,11 @@ def _updateNodeCommandClasses(self, node):
def _updateNodeNeighbors(self, node):
'''Update node's neighbor list'''
# TODO: I believe this is an OZW bug, but sleeping nodes report very odd (and long) neighbor lists
- neighborstr = str(self._manager.getNodeNeighbors(node._homeId, node._nodeId))
- if neighborstr is None or neighborstr == 'None':
+ neighbors = self._manager.getNodeNeighbors(node._homeId, node._nodeId)
+ if neighbors is None:
node._neighbors = None
else:
- node._neighbors = sorted([int(i) for i in filter(None, neighborstr.strip('()').split(','))])
+ node._neighbors = sorted(neighbors)
if node.isSleeping and node._neighbors is not None and len(node._neighbors) > 10:
self._log.warning('Probable OZW bug: Node [%d] is sleeping and reports %d neighbors; marking neighbors as none.', node.id, len(node._neighbors))
View
@@ -285,7 +285,12 @@ cdef addValueId(ValueID v, n):
cdef string label
cdef string units
cdef Manager *manager = Get()
- manager.GetValueAsString(v, &value)
+
+ if PyValueTypes[v.GetType()] == "List":
+ manager.GetValueListSelection(v, &value)
+ else:
+ manager.GetValueAsString(v, &value)
+
label = manager.GetValueLabel(v)
units = manager.GetValueUnits(v)
n['valueId'] = {'homeId' : v.GetHomeId(),
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Product>
- <!-- Configuration Parameters -->
- <CommandClass id="112">
- <Value type="list" index="1" genre="config" label="Ignore Start-Level (Transmitting)">
- <Help>Dimmers controlled by this switch will start dimming from their current level.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="list" index="2" genre="config" label="Suspend Group 4">
- <Help>Disable transmitting commands to Z-Wave devices that are in Group 4 without disassociating those devices from the group.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="list" index="13" genre="config" label="Disable Group 4 During Dim">
- <Help>Units in Group 4 only track when the dimmer is being turned ON and OFF and not while dimming.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="list" index="3" genre="config" label="Night Light">
- <Help>In night-light mode the LED on the switch will turn ON when the switch is turned OFF.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="list" index="4" genre="config" label="Invert Switch">
- <Help>Change the top of the switch to OFF and the bottom of the switch to ON. Note: If you invert the switches and also install the product upside down, remember the load will now be controlled by the right, not the left switch.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="list" index="5" genre="config" label="Ignore Start-Level (Receiving)">
- <Help>This dimmer will start dimming from its current level.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="list" index="6" genre="config" label="Don't Send Level After Dim">
- <Help>When you press and hold the bottom of the ZDM230 switch once, the Z-Wave devices that are associated into Group 1 are sent the Dim command. If this parameter is set to &quot;Yes&quot; the devices in Group 1 will not go to the same level as the ZDM230.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="byte" index="7" genre="config" label="On/Off Command Dim Step" units="" min="1" max="99">
- <Help>Indicates how many levels the dimmer will change for each dimming step.</Help>
- </Value>
- <Value type="byte" index="8" genre="config" label="On/Off Command Dim Rate" units="x 10 milliseconds" min="1" max="255">
- <Help>This value indicates in 10 millisecond resolution, how often the dim level will change. For example, if you set this parameter to 1, then every 10ms the dim level will change. If you set it to 255, then every 2.55 seconds the dim level will change.</Help>
- </Value>
- <Value type="byte" index="9" genre="config" label="Local Control Dim Step" units="" min="1" max="99">
- <Help>Indicates how many levels the dimmer will change for each dimming step.</Help>
- </Value>
- <Value type="byte" index="10" genre="config" label="Local Control Dim Rate" units="x 10 milliseconds" min="1" max="255">
- <Help>This value indicates in 10 millisecond resolution, how often the dim level will change. For example, if you set this parameter to 1, then every 10ms the dim level will change. If you set it to 255, then every 2.55 seconds the dim level will change.</Help>
- </Value>
- <Value type="byte" index="11" genre="config" label="ALL ON/ALL OFF Dim Step" units="" min="1" max="99">
- <Help>Indicates how many levels the dimmer will change for each dimming step.</Help>
- </Value>
- <Value type="byte" index="12" genre="config" label="ALL ON/ALL OFF Dim Rate" units="x 10 milliseconds" min="1" max="255">
- <Help>This value indicates in 10 millisecond resolution, how often the dim level will change. For example, if you set this parameter to 1, then every 10ms the dim level will change. If you set it to 255, then every 2.55 seconds the dim level will change.</Help>
- </Value>
- <Value type="list" index="14" genre="config" label="Enable Shade Control Group 2">
- <Help>The ZDM230 can operate shade control devices via its group 2.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="list" index="15" genre="config" label="Enable Shade Control Group 3">
- <Help>The ZDM230 can operate shade control devices via its group 3.</Help>
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="list" index="19" genre="config" label="LED Transmission Indication">
- <Help>The ZDM230 will flicker its LED when it is transmitting to any of its 4 groups. This flickering can be set to not flicker at all, to flicker the entire time it is transmitting, or to flicker for only 1 second when it begins transmitting.</Help>
- <Item label="None" value="0" />
- <Item label="While Transmitting" value="1" />
- <Item label="One Second Maximum" value="2" />
- </Value>
- <Value type="list" index="22" genre="config" label="Enable Group 2 Polling">
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="byte" index="20" genre="config" label="Poll Group 2 Interval" units="minutes" min="1" max="255" />
- </CommandClass>
-
- <!-- Association Groups -->
- <CommandClass id="133">
- <Associations num_groups="4">
- <Group index="1" max_associations="5" label="Left Switch" />
- <Group index="2" max_associations="5" label="Right Switch" />
- <Group index="3" max_associations="5" label="Right Switch (2 Taps)" />
- <Group index="4" max_associations="5" label="Update Controller" auto="true" />
- </Associations>
- </CommandClass>
-</Product>
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Product>
- <!-- Configuration Parameters -->
- <CommandClass id="112">
- <Value type="list" index="17" genre="config" label="Mode">
- <Item label="Lighting" value="0" />
- <Item label="Alarm" value="1" />
- <Item label="Sensor" value="2" />
- </Value>
- <Value type="byte" index="18" genre="config" label="Off/Idle Delay" units="minutes" min="0" max="255" />
- <Value type="list" index="19" genre="config" label="Unsolicited Commands">
- <Item label="No" value="0" />
- <Item label="Yes" value="1" />
- </Value>
- <Value type="byte" index="22" genre="config" label="Awake Time" units="seconds" min="15" max="45" />
- </CommandClass>
-
- <!-- Association Groups -->
- <CommandClass id="133">
- <Associations num_groups="3">
- <Group index="1" max_associations="5" label="Motion" auto="true"/>
- <Group index="2" max_associations="5" label="Tamper" />
- <Group index="3" max_associations="5" label="Battery" auto="true" />
- </Associations>
- </CommandClass>
-</Product>
-
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Product>
- <!-- Configuration Parameters -->
- <CommandClass id="112">
- <Value type="bool" index="29" genre="config" label="Load Sense" units="" min="0" max="1" />
- </CommandClass>
-</Product>
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Product>
- <!-- Configuration Parameters -->
- <CommandClass id="112">
- <Value type="bool" index="241" genre="config" label="Button #1 Programmable" units="" min="0" max="1" />
- <Value type="bool" index="242" genre="config" label="Button #2 Programmable" units="" min="0" max="1" />
- <Value type="bool" index="243" genre="config" label="Button #3 Programmable" units="" min="0" max="1" />
- <Value type="bool" index="244" genre="config" label="Button #4 Programmable" units="" min="0" max="1" />
- </CommandClass>
-
- <!-- COMMAND_CLASS_VERSION. This class is in the list reported by the Minimote, but it does not respond to requests -->
- <CommandClass id="134" action="remove" />
-
- <!-- COMMAND_CLASS_WAKE_UP. This class is in the list reported by the Minimote, but it does not
- respond to requests. It still needs to be supported so that wake up notifications are handled. -->
- <CommandClass id="132" create_vars="false" />
-
- <!-- COMMAND_CLASS_ASSOCIATION. This class is in the list reported by the Minimote, but it does not respond to requests -->
- <CommandClass id="133">
- <Group index="0" max_associations="1" label="Button #1" auto="false" write_only="true" />
- <Group index="40" max_associations="1" label="Button #2" auto="false" write_only="true" />
- <Group index="80" max_associations="1" label="Button #3" auto="false" write_only="true" />
- <Group index="120" max_associations="1" label="Button #4" auto="false" write_only="true" />
- </CommandClass>
-
- <!-- COMMAND_CLASS_ASSOCIATION_COMMAND_CONFIGURATION. This class is supported but is missing from the list reported by the Minimote -->
- <CommandClass id="155" action="add" />
-
-</Product>
-
Oops, something went wrong.

0 comments on commit 00f6e13

Please sign in to comment.