|
From: <ma...@us...> - 2011-02-13 13:03:59
|
Revision: 293
http://openautomation.svn.sourceforge.net/openautomation/?rev=293&view=rev
Author: mayerch
Date: 2011-02-13 13:03:53 +0000 (Sun, 13 Feb 2011)
Log Message:
-----------
Fix DPT 5.004 (and thus also the important 5.010) encoding when a non natural number (i.e. no integer) got passed.
This caused troubles in the very important case where a slider is connected to a dimmer.
Modified Paths:
--------------
CometVisu/trunk/visu/transforms/transform_knx.js
Modified: CometVisu/trunk/visu/transforms/transform_knx.js
===================================================================
--- CometVisu/trunk/visu/transforms/transform_knx.js 2011-02-11 22:35:52 UTC (rev 292)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2011-02-13 13:03:53 UTC (rev 293)
@@ -82,7 +82,7 @@
name : 'DPT_Percent_U8',
unit : '%',
encode: function( phy ){
- var val = phy.toString( 16 );
+ var val = parseInt( phy ).toString( 16 );
return (val.length == 1 ? '800' : '80') + val;
},
decode: function( hex ){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|