|
From: <ma...@us...> - 2010-12-09 22:27:19
|
Revision: 189
http://openautomation.svn.sourceforge.net/openautomation/?rev=189&view=rev
Author: makki1
Date: 2010-12-09 22:27:13 +0000 (Thu, 09 Dec 2010)
Log Message:
-----------
Fix DPT9/EIS5 encode-routine in pywiregate
Modified Paths:
--------------
PyWireGate/trunk/knx_connector/DPT_Types.py
Modified: PyWireGate/trunk/knx_connector/DPT_Types.py
===================================================================
--- PyWireGate/trunk/knx_connector/DPT_Types.py 2010-12-09 20:37:27 UTC (rev 188)
+++ PyWireGate/trunk/knx_connector/DPT_Types.py 2010-12-09 22:27:13 UTC (rev 189)
@@ -280,7 +280,7 @@
if val < 0:
sign = 0x8000
mant = val * 100
- while mant > 0x07ff:
+ while (mant > 2047) or (mant < -2048):
mant = mant >> 1
exp +=1
data = sign | (exp << 11) | (int(mant) & 0x07ff)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|