|
From: <ma...@us...> - 2011-02-20 20:57:51
|
Revision: 301
http://openautomation.svn.sourceforge.net/openautomation/?rev=301&view=rev
Author: mayerch
Date: 2011-02-20 20:57:45 +0000 (Sun, 20 Feb 2011)
Log Message:
-----------
- Added transform for datapoint 20.102 (DPT_HVACMode)
- Extended the transform data structure by a "range" element that might contain min/max or an enum
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-20 15:52:44 UTC (rev 300)
+++ CometVisu/trunk/visu/transforms/transform_knx.js 2011-02-20 20:57:45 UTC (rev 301)
@@ -225,6 +225,57 @@
},
unit : '-'
},
+ '20.102': {
+ name : 'DPT_HVACMode',
+ lname : {
+ 'de': 'KONNEX Betriebsart'
+ },
+ unit : '-',
+ range : {
+ enum: [ 'auto', 'comfort', 'standby', 'economy', 'building_protection' ]
+ },
+ encode: function( phy ){
+ var val;
+ switch( phy )
+ {
+ case 1:
+ case 'comfort':
+ val = 1;
+ break;
+ case 2:
+ case 'standby':
+ val = 2;
+ break;
+ case 3:
+ case 'economy':
+ val = 3;
+ break;
+ case 4:
+ case 'building_protection':
+ val = 4;
+ break;
+ default: // actually "case 0:" / "auto"
+ val = 0;
+ }
+ val = val.toString( 16 );
+ return (val.length == 1 ? '800' : '80') + val;
+ },
+ decode: function( hex ){
+ switch( parseInt( hex, 16 ) )
+ {
+ case 1:
+ return 'comfort';
+ case 2:
+ return 'standby';
+ case 3:
+ return 'economy';
+ case 4:
+ return 'building_protection';
+ default: // actually "case 0:"
+ return 'auto';
+ }
+ },
+ },
/* 9 Zeilen:
},
'.001' : {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|