22
33 < div class ="ui-grid-a ">
44 < div class ="ui-block-a ">
5- < span data-locale-id ="device_port "> Device Port</ span >
6- < div data-role ="controlgroup " data-type ="horizontal " data-mini ="true ">
7- < select data-ui-field ="serialport " data-mini ="true "> </ select >
8- </ div >
9- </ div >
10- < div class ="ui-block-a ">
11- < span data-locale-id ="command_delay "> Command Delay</ span >
12- < div data-role ="controlgroup " data-type ="horizontal " data-mini ="true ">
13- < select data-ui-field ="commanddelay " data-mini ="true "> </ select >
14- </ div >
15- </ div >
16- < div class ="ui-block-a ">
17- < span data-locale-id ="startup_discovery "> Discovery on Startup</ span >
18- < div data-role ="controlgroup " data-type ="horizontal " data-mini ="true ">
19- < select data-ui-field ="startupdiscovery " data-mini ="true "> </ select >
5+ < div class ="ui-grid-b ">
6+ < div class ="ui-block-a ">
7+ < span data-locale-id ="device_port "> Device Port</ span >
8+ < div data-role ="controlgroup " data-type ="horizontal " data-mini ="true ">
9+ < select data-ui-field ="serialport " data-mini ="true "> </ select >
10+ </ div >
11+ </ div >
12+ < div class ="ui-block-b ">
13+ < span data-locale-id ="startup_discovery "> Discovery on Startup</ span >
14+ < div data-role ="controlgroup " data-type ="horizontal " data-mini ="true ">
15+ < select data-ui-field ="startupdiscovery " data-mini ="true ">
16+ < option value ="1 "> Yes</ option >
17+ < option value ="0 "> No</ option >
18+ </ select >
19+ </ div >
20+ </ div >
21+ < div class ="ui-block-c ">
22+ < span data-locale-id ="command_delay "> Command Delay</ span >
23+ < div data-role ="controlgroup " data-type ="horizontal " data-mini ="true ">
24+ < select data-ui-field ="commanddelay " data-mini ="true ">
25+ < option value ="100 "> 100ms</ option >
26+ < option value ="150 "> 150ms</ option >
27+ < option value ="200 "> 200ms</ option >
28+ < option value ="250 "> 250ms</ option >
29+ < option value ="300 "> 300ms</ option >
30+ < option value ="400 "> 400ms</ option >
31+ < option value ="500 "> 500ms</ option >
32+ < option value ="750 "> 750ms</ option >
33+ </ select >
34+ </ div >
35+ </ div >
2036 </ div >
2137 </ div >
2238 < div class ="ui-block-b " align ="right ">
3349 < span data-locale-id ="common_tasks "> ZWave Common Tasks</ span >
3450 < div data-role ="controlgroup " data-type ="horizontal " data-mini ="true ">
3551 < a data-ui-field ="discovery_btn " data-locale-id ="discovery " class ="ui-btn ui-icon-search ui-btn-icon-left "> Discovery</ a >
36- < a data-ui-field ="healnetwork_btn " data-locale-id ="healnetwork " class ="ui-btn ui-icon-search ui-btn-icon-left "> Heal Network</ a >
3752 < a data-ui-field ="addnode_btn " data-locale-id ="add_node " class ="ui-btn ui-icon-plus ui-btn-icon-left "> Add Node</ a >
3853 < a data-ui-field ="removenode_btn " data-locale-id ="remove_node " class ="ui-btn ui-icon-minus ui-btn-icon-left "> Remove Node</ a >
54+ < a data-ui-field ="healnetwork_btn " data-locale-id ="healnetwork " class ="ui-btn ui-icon-heart ui-btn-icon-left "> Heal Network</ a >
3955 < a data-ui-field ="hardreset_btn " data-locale-id ="hard_reset_heading " class ="ui-btn ui-icon-alert ui-btn-icon-left "> Hard Reset</ a >
4056 </ div >
4157 </ div >
4864 < h1 data-locale-id ="discovery_heading "> ZWave Discovery</ h1 >
4965 </ div >
5066 < div class ="ui-content ui-corner-bottom " style ="height:280px;max-height:280px;overflow-y:scroll;overflow-x:hidden; ">
51- < p data-ui-field ="discovery_log " data-role =" listview " style ="font-family:monospace; font-size:8pt; "> </ p >
67+ < p data-ui-field ="discovery_log " style ="font-family:monospace; font-size:8pt; "> </ p >
5268 </ div >
5369 < div data-role ="footer " data-tap-toggle ="false " align ="center ">
5470 < a href ="#page_configure_groups " class ="ui-btn ui-corner-all ui-icon-gear ui-btn-icon-left " style ="margin:8px "> Configure Groups and Modules</ a >
@@ -61,7 +77,7 @@ <h1 data-locale-id="discovery_heading">ZWave Discovery</h1>
6177 < h1 data-locale-id ="healnetwork_heading "> ZWave Network Heal</ h1 >
6278 </ div >
6379 < div class ="ui-content ui-corner-bottom " style ="height:280px;max-height:280px;overflow-y:scroll;overflow-x:hidden; ">
64- < p data-ui-field ="healnetwork_log " data-role =" listview " style ="font-family:monospace; font-size:8pt; "> </ p >
80+ < p data-ui-field ="healnetwork_log " style ="font-family:monospace; font-size:8pt; "> </ p >
6581 </ div >
6682 </ div >
6783
@@ -118,37 +134,33 @@ <h2 data-ui-field="nodeid" align="center"></h2>
118134 }
119135 } ) ;
120136 } ) ;
121- // populate startup discovery list
122- startupDiscoverySelect . empty ( ) ;
123- startupDiscoverySelect . append ( '<option value="1">Yes</option>' ) ;
124- startupDiscoverySelect . append ( '<option value="0">No</option>' ) ;
125- // set current configured startup discovery
137+
138+ startupDiscoverySelect . selectmenu ( ) . selectmenu ( 'refresh' , true ) ;
139+ // get current configured startup discovery
126140 HG . Configure . MIG . InterfaceCommand ( _this . Id , 'Options.Get' , 'StartupDiscovery' , '' , function ( startupDiscovery ) {
127- startupDiscoverySelect . val ( startupDiscovery . ResponseValue ) ;
128- startupDiscoverySelect . selectmenu ( 'refresh' , true ) ;
141+ if ( startupDiscovery && startupDiscovery . ResponseValue != '' ) {
142+ startupDiscoverySelect . val ( startupDiscovery . ResponseValue ) ;
143+ startupDiscoverySelect . selectmenu ( 'refresh' , true ) ;
144+ }
129145 } ) ;
130146 // bind to startup discovery change event
131147 startupDiscoverySelect . change ( function ( event ) {
132148 HG . Configure . MIG . InterfaceCommand ( _this . Id , 'Options.Set' , 'StartupDiscovery' , encodeURIComponent ( $ ( this ) . val ( ) ) ) ;
133149 } ) ;
134150
135- // populate command delay list
136- delaySelect . empty ( ) ;
137- delaySelect . append ( '<option value="0">0</option>' ) ;
138- delaySelect . append ( '<option value="50">50</option>' ) ;
139- delaySelect . append ( '<option value="100">100</option>' ) ;
140- delaySelect . append ( '<option value="250">250</option>' ) ;
141- delaySelect . append ( '<option value="500">500</option>' ) ;
142- delaySelect . append ( '<option value="1000">1000</option>' ) ;
143- // set current configured delay
151+ delaySelect . selectmenu ( ) . selectmenu ( 'refresh' , true ) ;
152+ // get current configured delay
144153 HG . Configure . MIG . InterfaceCommand ( _this . Id , 'Options.Get' , 'Delay' , '' , function ( delay ) {
145- delaySelect . val ( delay . ResponseValue ) ;
146- delaySelect . selectmenu ( 'refresh' , true ) ;
154+ if ( delay && delay . ResponseValue != '' ) {
155+ delaySelect . val ( delay . ResponseValue ) ;
156+ delaySelect . selectmenu ( 'refresh' , true ) ;
157+ }
147158 } ) ;
148- // bind to port select change event
159+ // bind to command delay change event
149160 delaySelect . change ( function ( event ) {
150161 HG . Configure . MIG . InterfaceCommand ( _this . Id , 'Options.Set' , 'Delay' , encodeURIComponent ( $ ( this ) . val ( ) ) ) ;
151162 } ) ;
163+
152164 // populate serial port list
153165 HG . Configure . Interfaces . ServiceCall ( 'Hardware.SerialPorts' , function ( ports ) {
154166 portSelect . empty ( ) ;
@@ -242,9 +254,9 @@ <h2 data-ui-field="nodeid" align="center"></h2>
242254 zwave_NodeAdd ( function ( res ) {
243255 var nodeid = _this . NodeOperationPopup . find ( '[data-ui-field=nodeid]' ) ;
244256 var message = _this . NodeOperationPopup . find ( '[data-ui-field=message]' ) ;
245- if ( res != 0 ) {
257+ if ( res . ResponseValue != 0 ) {
246258 HG . WebApp . Control . UpdateModules ( ) ;
247- nodeid . html ( res ) ;
259+ nodeid . html ( res . ResponseValue ) ;
248260 message . html ( 'node added.' ) ;
249261 }
250262 else {
@@ -263,9 +275,9 @@ <h2 data-ui-field="nodeid" align="center"></h2>
263275 zwave_NodeRemove ( function ( res ) {
264276 var nodeid = _this . NodeOperationPopup . find ( '[data-ui-field=nodeid]' ) ;
265277 var message = _this . NodeOperationPopup . find ( '[data-ui-field=message]' ) ;
266- if ( res != 0 ) {
278+ if ( res . ResponseValue != 0 ) {
267279 HG . WebApp . Control . UpdateModules ( ) ;
268- nodeid . html ( res ) ;
280+ nodeid . html ( res . ResponseValue ) ;
269281 message . html ( 'node removed.' ) ;
270282 }
271283 else {
0 commit comments